summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-11-29 22:08:12 -0800
committerZac Medico <zmedico@gentoo.org>2010-11-29 22:08:12 -0800
commit2bc977e80ccfeb70357444be4de488f067a9d290 (patch)
tree465de9e280a35282499445181446fede13881ccc
parenta4cfd76e895ef9bf22df999f8250b67c3b783cce (diff)
downloadportage-2bc977e80ccfeb70357444be4de488f067a9d290.tar.gz
portage-2bc977e80ccfeb70357444be4de488f067a9d290.tar.bz2
portage-2bc977e80ccfeb70357444be4de488f067a9d290.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 69592b680..c5980c227 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -128,7 +128,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, myrepo)
- if atom.use:
+ if atom.unevaluated_atom.use:
cpv_iter = self._iter_match_use(atom, cpv_iter, myrepo)
if atom.repo:
cpv_iter = self._iter_match_repo(atom, cpv_iter, myrepo)
@@ -165,7 +165,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
@@ -173,11 +173,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)