From: Zac Medico Date: Mon, 20 Nov 2006 03:03:08 +0000 (-0000) Subject: Use mydbapi is None to eliminate the return_all_deps parameter from dep_check and... X-Git-Tag: v2.1.2~444 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=89f4b744cbfaf440d8c781033313a220276bde13;p=portage.git Use mydbapi is None to eliminate the return_all_deps parameter from dep_check and dep_zapdeps. The result is the same and this way we avoid having an additional parameter with overlapping meaning. svn path=/main/trunk/; revision=5092 --- diff --git a/bin/emerge b/bin/emerge index 6417ff971..3c4d859d4 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1195,10 +1195,10 @@ class depgraph: #processing dependencies """ Call portage.dep_check to evaluate the use? conditionals and make sure all dependencies are satisfiable. """ - mycheck = portage.dep_check(depstring, self.mydbapi[myroot], + mycheck = portage.dep_check(depstring, None, pkgsettings, myuse=myuse, use_binaries=("--usepkgonly" in self.myopts), - myroot=myroot, trees=self.trees, return_all_deps=True) + myroot=myroot, trees=self.trees) if not mycheck[0]: sys.stderr.write("\n\n%s\n\n" % mycheck[1]) diff --git a/pym/portage.py b/pym/portage.py index 04442cb8a..ec92108a9 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3580,16 +3580,14 @@ def dep_eval(deplist): return 0 return 1 -def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None, - return_all_deps=False): +def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): """Takes an unreduced and reduced deplist and removes satisfied dependencies. Returned deplist contains steps that must be taken to satisfy dependencies.""" if trees is None: global db trees = db writemsg("ZapDeps -- %s\n" % (use_binaries), 2) - if not reduced or unreduced == ["||"] or \ - (not return_all_deps and dep_eval(reduced)): + if not reduced or unreduced == ["||"] or dep_eval(reduced): return [] if unreduced[0] != "||": @@ -3597,9 +3595,8 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None, for (dep, satisfied) in zip(unreduced, reduced): if isinstance(dep, list): unresolved += dep_zapdeps(dep, satisfied, myroot, - use_binaries=use_binaries, trees=trees, - return_all_deps=return_all_deps) - elif not satisfied or return_all_deps: + use_binaries=use_binaries, trees=trees) + elif not satisfied: unresolved.append(dep) return unresolved @@ -3628,8 +3625,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None, for (dep, satisfied) in zip(deps, satisfieds): if isinstance(dep, list): atoms = dep_zapdeps(dep, satisfied, myroot, - use_binaries=use_binaries, trees=trees, - return_all_deps=return_all_deps) + use_binaries=use_binaries, trees=trees) else: atoms = [dep] @@ -3716,7 +3712,7 @@ def dep_expand(mydep, mydb=None, use_cache=1, settings=None): mydep, mydb=mydb, use_cache=use_cache, settings=settings) + postfix def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, - use_cache=1, use_binaries=0, myroot="/", trees=None, return_all_deps=False): + use_cache=1, use_binaries=0, myroot="/", trees=None): """Takes a depend string and parses the condition.""" edebug = mysettings.get("PORTAGE_DEBUG", None) == "1" #check_config_instance(mysettings) @@ -3771,8 +3767,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, try: mysplit = _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, use=use, mode=mode, myuse=myuse, use_cache=use_cache, - use_binaries=use_binaries, myroot=myroot, trees=trees, - return_all_deps=return_all_deps) + use_binaries=use_binaries, myroot=myroot, trees=trees) except portage_exception.ParseError, e: return [0, str(e)] @@ -3786,8 +3781,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, writemsg("mysplit2: %s\n" % (mysplit2), 1) myzaps = dep_zapdeps(mysplit, mysplit2, myroot, - use_binaries=use_binaries, trees=trees, - return_all_deps=return_all_deps) + use_binaries=use_binaries, trees=trees) mylist = flatten(myzaps) writemsg("myzaps: %s\n" % (myzaps), 1) writemsg("mylist: %s\n" % (mylist), 1) @@ -3800,14 +3794,17 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, def dep_wordreduce(mydeplist,mysettings,mydbapi,mode,use_cache=1): "Reduces the deplist to ones and zeros" - mypos=0 deplist=mydeplist[:] - while mypos