From 9f8ddbf6c0fd20d5fd1d8fe6dfd530af9c867c71 Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Sat, 17 Dec 2005 05:59:16 +0000 Subject: [PATCH] Check if atoms with matching keys will result in higher versioned packages when dealing with || ( ) type dependencies. #100876 svn path=/main/trunk/; revision=2389 --- bin/emerge | 3 +- pym/portage.py | 131 ++++++++++++++++--------------------------------- 2 files changed, 44 insertions(+), 90 deletions(-) diff --git a/bin/emerge b/bin/emerge index b4474bb0d..4ce5130e0 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1188,8 +1188,7 @@ class depgraph: print "Depstring:",depstring if not arg: #processing dependencies - mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse,use_binaries=("--usepkg" in myopts)) - #mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse) + mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse,use_binaries=("--usepkgonly" in myopts),myroot=myroot) if not mycheck[0]: mymerge=[] diff --git a/pym/portage.py b/pym/portage.py index cdd9ba764..bfaa1dee2 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3238,7 +3238,7 @@ def dep_eval(deplist): return 0 return 1 -def dep_zapdeps(unreduced,reduced,vardbapi=None,use_binaries=0): +def dep_zapdeps(unreduced,reduced,myroot,use_binaries=0): """Takes an unreduced and reduced deplist and removes satisfied dependencies. Returned deplist contains steps that must be taken to satisfy dependencies.""" writemsg("ZapDeps -- %s\n" % (use_binaries), 2) @@ -3246,88 +3246,52 @@ def dep_zapdeps(unreduced,reduced,vardbapi=None,use_binaries=0): return [] if unreduced[0]=="||": if dep_eval(reduced): - #deps satisfied, return empty list. return [] - else: - #try to find an installed dep. - ### We use fakedb when --update now, so we can't use local vardbapi here. - ### This should be fixed in the feature. - ### see bug 45468. - ##if vardbapi: - ## mydbapi=vardbapi - ##else: - ## mydbapi=db[root]["vartree"].dbapi - mydbapi=db[root]["vartree"].dbapi - - if db["/"].has_key("porttree"): - myportapi=db["/"]["porttree"].dbapi - else: - myportapi=None - if use_binaries and db["/"].has_key("bintree"): - mybinapi=db["/"]["bintree"].dbapi - writemsg("Using bintree...\n",2) + found_idx = 1 + for x in range(1, len(unreduced)): + if isinstance(unreduced[x], list): + atom_list = dep_zapdeps(unreduced[x], reduced[x], myroot, use_binaries=use_binaries) else: - mybinapi=None + atom_list = [unreduced[x]] + all_found = True + for atom in atom_list: + if not db[myroot]["vartree"].dbapi.match(atom): + all_found = False + break + if all_found: + if isinstance(unreduced[x], list): + return atom_list + found_idx = x + break - x=1 - candidate=[] - while x=1) if deplist[mypos][0]=="!": - #tmp=not tmp - # This is ad-hoc code. We should rewrite this later.. (See #52377) - # The reason is that portage uses fakedb when --update option now. - # So portage considers that a block package doesn't exist even if it exists. - # Then, #52377 happens. - # ==== start - # emerge checks if it's block or not, so we can always set tmp=False. - # but it's not clean.. tmp=False - # ==== end deplist[mypos]=tmp else: #encountered invalid string -- 2.26.2