[entropy.db] remove checkReadOnly() idiocy and handle read-only mode only on commit
This commit is contained in:
@@ -748,9 +748,7 @@ class EntropyRepository:
|
||||
return True
|
||||
return False
|
||||
|
||||
# never use this unless you know what you're doing
|
||||
def initializeDatabase(self):
|
||||
self.checkReadOnly()
|
||||
my = self.Schema()
|
||||
for table in self.listAllTables():
|
||||
try:
|
||||
@@ -765,13 +763,6 @@ class EntropyRepository:
|
||||
self.setDefaultCacheSize(8192)
|
||||
self.commitChanges()
|
||||
|
||||
def checkReadOnly(self):
|
||||
if self.readOnly:
|
||||
raise OperationNotPermitted("OperationNotPermitted: %s." % (
|
||||
_("can't do that on a readonly database"),
|
||||
)
|
||||
)
|
||||
|
||||
# check for /usr/portage/profiles/updates changes
|
||||
def serverUpdatePackagesData(self):
|
||||
|
||||
@@ -1395,8 +1386,6 @@ class EntropyRepository:
|
||||
def handlePackage(self, etpData, forcedRevision = -1,
|
||||
formattedContent = False):
|
||||
|
||||
self.checkReadOnly()
|
||||
|
||||
if self.clientDatabase:
|
||||
return self.addPackage(etpData, revision = forcedRevision,
|
||||
formatted_content = formattedContent)
|
||||
@@ -1480,8 +1469,6 @@ class EntropyRepository:
|
||||
def addPackage(self, etpData, revision = -1, idpackage = None,
|
||||
do_remove = True, do_commit = True, formatted_content = False):
|
||||
|
||||
self.checkReadOnly()
|
||||
|
||||
if revision == -1:
|
||||
try:
|
||||
revision = int(etpData['revision'])
|
||||
@@ -1721,7 +1708,6 @@ class EntropyRepository:
|
||||
def removePackage(self, idpackage, do_cleanup = True, do_commit = True,
|
||||
do_rss = True):
|
||||
|
||||
self.checkReadOnly()
|
||||
# clear caches
|
||||
self.clearCache()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user