Entropy/EquoInterface/ServerInterface:

- get_missing_rdepends: use a deep dependency list instead


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1660 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-04-10 10:06:40 +00:00
parent c1aea1dba2
commit 852182d104
2 changed files with 38 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
TODO list
- Server-side code refactoring:
- if an extract_pkg_metadata fails, no injection will be done
[] write a ncurses interface to manage entropy database + spm interface + GLSA
- split RDEPEND and PDEPEND ( + && and || ??? ) (*)
- add i18n support (*)
+37 -1
View File
@@ -2536,11 +2536,47 @@ class EquoInterface(TextInterface):
self.spmCache[myroot] = conn.intf
return conn.intf
def get_deep_dependency_list(self, dbconn, idpackage, atoms = False):
mybuffer = self.entropyTools.lifobuffer()
matchcache = set()
depcache = set()
mydeps = dbconn.retrieveDependencies(idpackage)
for mydep in mydeps:
mybuffer.push(mydep)
mydep = mybuffer.pop()
while mydep != None:
if mydep in depcache:
mydep = mybuffer.pop()
continue
mymatch = dbconn.atomMatch(mydep)
if atoms:
matchcache.add(mydep)
else:
matchcache.add(mymatch[0])
if mymatch[0] != -1:
owndeps = dbconn.retrieveDependencies(mymatch[0])
for owndep in owndeps:
mybuffer.push(owndep)
depcache.add(mydep)
mydep = mybuffer.pop()
if atoms and -1 in matchcache:
matchcache.remove(-1)
return matchcache
def get_missing_rdepends(self, dbconn, idpackage):
rdepends = set()
neededs = dbconn.retrieveNeeded(idpackage, extended = True)
deps_content = set()
dependencies = dbconn.retrieveDependencies(idpackage)
dependencies = self.get_deep_dependency_list(dbconn, idpackage, atoms = True)
dependencies_cache = set()
for dependency in dependencies:
match = dbconn.atomMatch(dependency)