diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-27 15:15:19 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-27 15:15:19 +0000 |
commit | 7f13c3ab48f419f0b9996b26fa247942ca3ddd64 (patch) | |
tree | c9c3787bed7e2f4f3ee3b42c907982f84417fd34 | |
parent | 701c7cdcb78ce3c1cdc5e31a73385506781a9ed8 (diff) | |
download | portage-7f13c3ab48f419f0b9996b26fa247942ca3ddd64.tar.gz portage-7f13c3ab48f419f0b9996b26fa247942ca3ddd64.tar.bz2 portage-7f13c3ab48f419f0b9996b26fa247942ca3ddd64.zip |
Instead of just a list, use a cat/pkg dict for matching packages against args in the depgraph.
svn path=/main/trunk/; revision=7061
-rw-r--r-- | pym/emerge/__init__.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 4737ab393..bc7c7a635 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -978,7 +978,7 @@ class depgraph(object): 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 = {} @@ -1112,7 +1112,9 @@ class depgraph(object): 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) @@ -1443,7 +1445,9 @@ class depgraph(object): """ 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) @@ -1547,11 +1551,13 @@ class depgraph(object): 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 |