From f7b331b248e6d59b7566d68381d5ecbb0d4dcacb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 23 Sep 2006 05:13:01 +0000 Subject: Never allow packages explicitly requested on the command line to be tagged "nomerge" unless --noreplace has been specified. This patch accomplishes the same goal as r4494 but without the potential for causing inconsistency in the depgraph. svn path=/main/trunk/; revision=4508 --- bin/emerge | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/emerge b/bin/emerge index a5f43a196..79eb6b5e1 100755 --- a/bin/emerge +++ b/bin/emerge @@ -690,6 +690,7 @@ class depgraph: trees[self.target_root]["bintree"].populate( "--getbinpkg" in self.myopts, "--getbinpkgonly" in self.myopts) + self.args_keys = [] def create(self, mybigkey, myparent=None, addme=1, myuse=None, soft_dep=False, rev_dep=False, arg=None): @@ -728,6 +729,8 @@ class depgraph: self.spinner.update() mytype,myroot,mykey=mybigkey + if not arg: + arg = portage.best_match_to_list(mykey, self.args_keys) # select the correct /var database that we'll be checking against vardbapi = self.trees[myroot]["vartree"].dbapi portdb = self.trees[myroot]["porttree"].dbapi @@ -764,7 +767,7 @@ class depgraph: merging=1 if addme: # this is where we add the node to the list of packages to merge - if not myparent: + if (arg and "--noreplace" not in self.myopts) or not myparent: """ If there is no parent, the package was specified on the command line or is part of system/world sets. In either case, if we aren't in 'self' mode (where package @@ -889,7 +892,9 @@ class depgraph: myfavorites=[] myroot = self.target_root portdb = self.trees[myroot]["porttree"].dbapi + bindb = self.trees[myroot]["bintree"].dbapi pkgsettings = self.pkgsettings[myroot] + self.args_keys = [] for x in myfiles: ext = os.path.splitext(x)[1] if ext==".tbz2": @@ -946,14 +951,18 @@ class depgraph: portage.writemsg("!!! (Did you specify a version but forget to prefix with '='?)\n") return (0,[]) try: + mykey = None + if "--usepkg" in self.myopts: + mykey = portage.dep_expand(x, mydb=bindb, + settings=pkgsettings) + if (mykey and not mykey.startswith("null/")) or \ + "--usepkgonly" in self.myopts: + self.args_keys.append(mykey) + continue + mykey = portage.dep_expand(x, mydb=portdb, settings=pkgsettings) - if mykey.startswith("null/"): - # If category expansion fails against the portage tree, - # remove the null/ prefix so that it may be given - # another chance to expand against the binary package - # tree in select_dep(). - mykey = mykey[5:] + self.args_keys.append(mykey) except ValueError, errpkgs: print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" print "!!! one of the following fully-qualified ebuild names instead:\n" @@ -962,11 +971,7 @@ class depgraph: print sys.exit(1) - # select needs to return 0 on dep_check failure - - sys.stdout.flush() - sys.stderr.flush() - + for mykey in self.args_keys: try: self.mysd = self.select_dep(myroot, mykey, arg=x) except portage_exception.MissingSignature, e: -- cgit v1.2.3-1-g7c22