summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-11-29 22:08:12 -0800
committerZac Medico <zmedico@gentoo.org>2010-12-03 22:27:09 -0800
commit9f956ff67ba07c837b13e6f82eddc2165e1b747e (patch)
tree86aeddeb3f401e9aa4a72b827ea4b99e6106ec75
parent1dec3fe20779ba5b1ef7305f93d95672c4313159 (diff)
downloadportage-9f956ff67ba07c837b13e6f82eddc2165e1b747e.tar.gz
portage-9f956ff67ba07c837b13e6f82eddc2165e1b747e.tar.bz2
portage-9f956ff67ba07c837b13e6f82eddc2165e1b747e.zip
dbapi: sync USE match logic with depgraph
This changes the IUSE check to use the unevaluated atom, and fixes some missing_enabled/disabled cases.
-rw-r--r--pym/portage/dbapi/__init__.py29
1 files changed, 22 insertions, 7 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index 3803339d5..ae48e53b3 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -127,7 +127,7 @@ class dbapi(object):
cpv_iter = iter(match_from_list(atom, cpv_iter))
if atom.slot:
cpv_iter = self._iter_match_slot(atom, cpv_iter)
- if atom.use:
+ if atom.unevaluated_atom.use:
cpv_iter = self._iter_match_use(atom, cpv_iter)
return cpv_iter
@@ -154,7 +154,7 @@ class dbapi(object):
use = use.split()
iuse = frozenset(x.lstrip('+-') for x in iuse.split())
missing_iuse = False
- for x in atom.use.required:
+ for x in atom.unevaluated_atom.use.required:
if x not in iuse and x not in atom.use.missing_enabled \
and x not in atom.use.missing_disabled and not iuse_implicit_match(x):
missing_iuse = True
@@ -162,11 +162,26 @@ class dbapi(object):
if missing_iuse:
continue
if not self._use_mutable:
- if atom.use.enabled.difference(use).difference(atom.use.missing_enabled):
- continue
- if atom.use.disabled.intersection(use) or \
- atom.use.disabled.difference(iuse).difference(atom.use.missing_disabled):
- continue
+ missing_enabled = atom.use.missing_enabled.difference(iuse)
+ missing_disabled = atom.use.missing_disabled.difference(iuse)
+
+ if atom.use.enabled:
+ if atom.use.enabled.intersection(missing_disabled):
+ continue
+ need_enabled = atom.use.enabled.difference(use)
+ if need_enabled:
+ need_enabled = need_enabled.difference(missing_enabled)
+ if need_enabled:
+ continue
+
+ if atom.use.disabled:
+ if atom.use.disabled.intersection(missing_enabled):
+ continue
+ need_disabled = atom.use.disabled.intersection(use)
+ if need_disabled:
+ need_disabled = need_disabled.difference(missing_disabled)
+ if need_disabled:
+ continue
else:
# Check masked and forced flags for repoman.
mysettings = getattr(self, 'settings', None)