From 703abfdfbb257ffd41db59c28c15b50b01f2e612 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@cd1c1023-2f26-0410-ae45-c471fc1f0318> Date: Mon, 10 Dec 2007 00:08:21 +0000 Subject: [PATCH] update rescueTools to work with chroots git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@820 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- client/equoTools.py | 4 ++-- client/rescueTools.py | 8 +++++--- libraries/databaseTools.py | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client/equoTools.py b/client/equoTools.py index 3ce3d44cf..8602853eb 100644 --- a/client/equoTools.py +++ b/client/equoTools.py @@ -1303,7 +1303,7 @@ def removePackageFromGentooDatabase(atom): @input package: dictionary containing information collected by installPackages (important are atom, slot, category, name, version) @output: 0 = all fine, >0 = error! ''' -def installPackageIntoGentooDatabase(infoDict,packageFile, newidpackage = -1): +def installPackageIntoGentooDatabase(infoDict, packageFile, newidpackage = -1): # handle gentoo-compat _portage_avail = False @@ -1327,7 +1327,7 @@ def installPackageIntoGentooDatabase(infoDict,packageFile, newidpackage = -1): # atomsfound = _portage_getInstalledAtoms(key) too slow! ### REMOVE - # parse slot and match and remove) + # parse slot and match and remove if atomsfound: pkgToRemove = '' for atom in atomsfound: diff --git a/client/rescueTools.py b/client/rescueTools.py index 4bf6318c2..9cf60253e 100644 --- a/client/rescueTools.py +++ b/client/rescueTools.py @@ -199,7 +199,7 @@ def database(options): # spawn process if os.path.isfile(etpConst['packagestmpfile']): os.remove(etpConst['packagestmpfile']) - os.system("find / -mount 1> "+etpConst['packagestmpfile']) + os.system("find "+etpConst['systemroot']+"/ -mount 1> "+etpConst['packagestmpfile']) if not os.path.isfile(etpConst['packagestmpfile']): print_error(darkred("Attention: ")+red("find couldn't generate an output file.")) return @@ -232,10 +232,10 @@ def database(options): # content content = dbconn.retrieveContent(idpackage) for file in content: - if file in filelist: + if etpConst['systemroot']+file in filelist: pkgsfound.add((idpackage,repo)) atoms[(idpackage,repo)] = idpackageatom - filelist.difference_update(set(content)) + filelist.difference_update(set([etpConst['systemroot']+x for x in content])) break dbconn.closeDB() @@ -450,6 +450,8 @@ def getinfo(dict = False): info['Equo pidfile'] = etpConst['pidfile'] info['Entropy database tag'] = etpConst['databasestarttag'] info['Repositories'] = etpRepositories + info['System Config'] = etpSys + info['UI Config'] = etpUi # client database info conn = False diff --git a/libraries/databaseTools.py b/libraries/databaseTools.py index e01ad75ab..8e1df589c 100644 --- a/libraries/databaseTools.py +++ b/libraries/databaseTools.py @@ -1225,6 +1225,8 @@ class etpDatabase: raise Exception, "I tried to insert a needed library but then, fetching it returned -1. There's something broken." def addLicense(self,license): + if not license: + license = ' ' # workaround for broken license entries dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"addLicense: adding License -> "+str(license)) self.cursor.execute( 'INSERT into licenses VALUES '