diff --git a/client/equoTools.py b/client/equoTools.py index 88f9ef04f..e9ce1a977 100644 --- a/client/equoTools.py +++ b/client/equoTools.py @@ -1155,7 +1155,7 @@ def generateRemovalTree(atoms): #print mydepends for depend in depends: if depend in treeview: - print "changed" + #print "changed" change = True try: while 1: @@ -1994,7 +1994,7 @@ def openClientDatabase(): conn = etpDatabase(readOnly = False, dbFile = etpConst['etpdatabaseclientfilepath'], clientDatabase = True) return conn else: - return -1 + raise Exception,"openClientDatabase: installed packages database not found. At this stage, the only way to have it is to run 'equo database generate'." ######################################################## diff --git a/libraries/databaseTools.py b/libraries/databaseTools.py index b7a59ec7e..794a3a7ea 100644 --- a/libraries/databaseTools.py +++ b/libraries/databaseTools.py @@ -847,7 +847,10 @@ class etpDatabase: def commitChanges(self): if (not self.readOnly): dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"commitChanges: writing changes to database.") - self.connection.commit() + try: + self.connection.commit() + except: + pass self.taintDatabase() else: dbLog.log(ETP_LOGPRI_WARNING,ETP_LOGLEVEL_VERBOSE,"commitChanges: discarding changes to database (opened readonly).") @@ -1382,6 +1385,8 @@ class etpDatabase: # now we have orphans that can be removed safely for idoflag in orphanedFlags: self.cursor.execute('DELETE FROM useflagsreference WHERE idflag = '+str(idoflag)) + for row in self.cursor: + x = row # really necessary ? def cleanupSources(self): dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"cleanupSources: called.") @@ -1400,6 +1405,8 @@ class etpDatabase: # now we have orphans that can be removed safely for idosrc in orphanedSources: self.cursor.execute('DELETE FROM sourcesreference WHERE idsource = '+str(idosrc)) + for row in self.cursor: + x = row # really necessary ? def cleanupDependencies(self): dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"cleanupDependencies: called.") @@ -1418,6 +1425,8 @@ class etpDatabase: # now we have orphans that can be removed safely for idodep in orphanedDeps: self.cursor.execute('DELETE FROM dependenciesreference WHERE iddependency = '+str(idodep)) + for row in self.cursor: + x = row # really necessary ? # WARNING: this function must be kept in sync with Entropy database schema # returns True if equal