Instead of just a list, use a cat/pkg dict for matching packages against args in...
authorZac Medico <zmedico@gentoo.org>
Wed, 27 Jun 2007 15:15:51 +0000 (15:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 27 Jun 2007 15:15:51 +0000 (15:15 -0000)
svn path=/main/branches/2.1.2/; revision=7062

bin/emerge

index b80cff9a7e386d90a2d19b0a6363bc2db14bd4b1..5c27d4b8880bcb58982b0b3d39d5d872c9c3ec50 100755 (executable)
@@ -977,7 +977,7 @@ class depgraph:
                self._parent_child_digraph = digraph()
                self.orderedkeys=[]
                self.outdatedpackages=[]
-               self.args_keys = []
+               self._args_atoms = {}
                self.blocker_digraph = digraph()
                self.blocker_parents = {}
                self._unresolved_blocker_parents = {}
@@ -1111,7 +1111,9 @@ class depgraph:
 
                if not arg and myroot == self.target_root:
                        cpv_slot = "%s:%s" % (mykey, mydbapi.aux_get(mykey, ["SLOT"])[0])
-                       arg = portage.best_match_to_list(cpv_slot, self.args_keys)
+                       cp = portage.dep_getkey(mykey)
+                       if cp in self._args_atoms:
+                               arg = portage.best_match_to_list(cpv_slot, self._args_atoms[cp])
 
                if myuse is None:
                        self.pkgsettings[myroot].setcpv(mykey, mydb=portdb)
@@ -1442,7 +1444,9 @@ class depgraph:
 
                """ These are used inside self.create() in order to ensure packages
                that happen to match arguments are not incorrectly marked as nomerge."""
-               self.args_keys = [x[1] for x in arg_atoms]
+               for myarg, myatom in arg_atoms:
+                       self._args_atoms.setdefault(
+                               portage.dep_getkey(myatom), []).append(myatom)
                for myarg, myatom in arg_atoms:
                                try:
                                        self.mysd = self.select_dep(myroot, myatom, arg=myarg)
@@ -1546,11 +1550,13 @@ class depgraph:
                                return 0
                        mymerge = mycheck[1]
 
-               if not mymerge and arg and \
-                       portage.best_match_to_list(depstring, self.args_keys):
+               if not mymerge and arg:
                        # A provided package has been specified on the command line.  The
                        # package will not be merged and a warning will be displayed.
-                       self._pprovided_args.append(arg)
+                       cp = portage.dep_getkey(depstring)
+                       if cp in self._args_atoms and \
+                               portage.match_to_list(depstring, self._args_atoms[cp]):
+                               self._pprovided_args.append(arg)
 
                if myparent:
                        # The parent is added after it's own dep_check call so that it