- dynamic configuration handling

- some fixes here and there
- added filesystem root change support


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@792 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2007-12-01 17:24:18 +00:00
parent c8e6b08f32
commit cd4fc9f4bf
11 changed files with 833 additions and 760 deletions
+28 -2
View File
@@ -2371,9 +2371,13 @@ class etpDatabase:
return self.fetchall2set(self.cursor.fetchall())
''' search packages that need the specified library (in neededreference table) specified by keyword '''
def searchNeeded(self, keyword):
def searchNeeded(self, keyword, like = False):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"searchNeeded: called for "+keyword)
self.cursor.execute('SELECT needed.idpackage FROM needed,neededreference WHERE library = "'+keyword+'" and needed.idneeded = neededreference.idneeded')
if like:
self.cursor.execute('SELECT needed.idpackage FROM needed,neededreference WHERE library LIKE "'+keyword+'" and needed.idneeded = neededreference.idneeded')
else:
self.cursor.execute('SELECT needed.idpackage FROM needed,neededreference WHERE library = "'+keyword+'" and needed.idneeded = neededreference.idneeded')
return self.fetchall2set(self.cursor.fetchall())
''' same as above but with branch support '''
@@ -2495,6 +2499,28 @@ class etpDatabase:
self.storeSearchCache((keyword,sensitive,branch),'searchPackagesByName',results)
return results
def searchPackagesByCategory(self, keyword, like = False branch = None):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"searchPackagesByCategory: called for "+keyword)
if (self.xcache):
cached = self.fetchSearchCache((keyword,branch),'searchPackagesByCategory')
if cached != None: return cached
branchstring = ''
if branch:
branchstring = ' and branch = "'+branch+'"'
if like:
self.cursor.execute('SELECT baseinfo.atom,baseinfo.idpackage FROM baseinfo,categories WHERE categories.category LIKE "'+keyword+'" and baseinfo.idcategory = categories.idcategory '+branchstring)
else:
self.cursor.execute('SELECT baseinfo.atom,baseinfo.idpackage FROM baseinfo,categories WHERE categories.category = "'+keyword+'" and baseinfo.idcategory = categories.idcategory '+branchstring)
results = self.cursor.fetchall()
if (self.xcache):
self.storeSearchCache((keyword,branch),'searchPackagesByCategory',results)
return results
def searchPackagesByNameAndCategory(self, name, category, sensitive = False, branch = None):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"searchPackagesByNameAndCategory: called for name: "+name+" and category: "+category)