- implemented a better way to look for needed table
- fixed a possible crash caused by exceptions in config protection retrieval git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1085 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -2359,6 +2359,9 @@ class etpDatabase(TextInterface):
|
||||
|
||||
def retrieveNeeded(self, idpackage):
|
||||
|
||||
if not self.doesNeededExist():
|
||||
self.createNeededTable()
|
||||
|
||||
self.cursor.execute('SELECT library FROM needed,neededreference WHERE needed.idpackage = (?) and needed.idneeded = neededreference.idneeded', (idpackage,))
|
||||
needed = self.fetchall2set(self.cursor.fetchall())
|
||||
|
||||
@@ -3244,6 +3247,13 @@ class etpDatabase(TextInterface):
|
||||
if rslt == None:
|
||||
raise exceptionTools.SystemDatabaseError("SystemDatabaseError: table extrainfo not found. Either does not exist or corrupted.")
|
||||
|
||||
def doesNeededExist(self):
|
||||
self.cursor.execute('select name from SQLITE_MASTER where type = (?) and name = (?)', ("table","needed"))
|
||||
rslt = self.cursor.fetchone()
|
||||
if rslt == None:
|
||||
return False
|
||||
return True
|
||||
|
||||
def tablesChecksum(self):
|
||||
# NOTE: if you will add dependstable to the validation
|
||||
# please have a look at EquoInterface.__install_package_into_database world calculation cache stuff
|
||||
|
||||
Reference in New Issue
Block a user