fix indexing when running readonly

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1130 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2008-02-04 20:01:33 +00:00
parent cf62aad37d
commit 5f5b6eda7f
+16 -4
View File
@@ -3451,26 +3451,38 @@ class etpDatabase(TextInterface):
def createContentIndex(self):
if self.dbname != "etpdb" and self.indexing:
self.checkReadOnly()
try:
self.checkReadOnly()
except exceptionTools.OperationNotPermitted:
return
self.cursor.execute('CREATE INDEX IF NOT EXISTS contentindex ON content ( file )')
self.commitChanges()
def createBaseinfoIndex(self):
if self.dbname != "etpdb" and self.indexing:
self.checkReadOnly()
try:
self.checkReadOnly()
except exceptionTools.OperationNotPermitted:
return
self.cursor.execute('CREATE INDEX IF NOT EXISTS baseindex ON baseinfo ( idpackage, atom, name, version, slot, branch, revision )')
self.commitChanges()
def createDependenciesIndex(self):
if self.dbname != "etpdb" and self.indexing:
self.checkReadOnly()
try:
self.checkReadOnly()
except exceptionTools.OperationNotPermitted:
return
self.cursor.execute('CREATE INDEX IF NOT EXISTS dependenciesindex ON dependencies ( idpackage, iddependency )')
self.cursor.execute('CREATE INDEX IF NOT EXISTS dependenciesreferenceindex ON dependenciesreference ( iddependency, dependency )')
self.commitChanges()
def createExtrainfoIndex(self):
if self.dbname != "etpdb" and self.indexing:
self.checkReadOnly()
try:
self.checkReadOnly()
except exceptionTools.OperationNotPermitted:
return
self.cursor.execute('CREATE INDEX IF NOT EXISTS extrainfoindex ON extrainfo ( idpackage, description, homepage, download, digest, datecreation, size )')
self.commitChanges()