summaryrefslogtreecommitdiffstats
path: root/pym/portage/sets/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/sets/base.py')
-rw-r--r--pym/portage/sets/base.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py
index f2e745157..f3cf37359 100644
--- a/pym/portage/sets/base.py
+++ b/pym/portage/sets/base.py
@@ -114,12 +114,16 @@ class PackageSet(object):
self._atommap.setdefault(a.cp, set()).add(a)
# Not sure if this one should really be in PackageSet
- def findAtomForPackage(self, pkg):
+ def findAtomForPackage(self, pkg, modified_use=None):
"""Return the best match for a given package from the arguments, or
None if there are no matches. This matches virtual arguments against
the PROVIDE metadata. This can raise an InvalidDependString exception
if an error occurs while parsing PROVIDE."""
+ if modified_use is not None and modified_use is not pkg.use.enabled:
+ pkg = pkg.copy()
+ pkg.metadata["USE"] = " ".join(modified_use)
+
# Atoms matched via PROVIDE must be temporarily transformed since
# match_from_list() only works correctly when atom.cp == pkg.cp.
rev_transform = {}