summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/depgraph.py29
-rw-r--r--pym/portage/dep/__init__.py22
2 files changed, 18 insertions, 33 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index dce1041e9..252975418 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2136,12 +2136,10 @@ class depgraph(object):
for pkg in missing_use:
use = self._pkg_use_enabled(pkg)
missing_iuse = []
- for x in pkg.iuse.get_missing_iuse(atom.use.required):
- #FIXME: If a use flag occures more then it might be possible that
- #one has a default one doesn't.
- if x not in atom.use.missing_enabled and \
- x not in atom.use.missing_disabled:
- missing_iuse.append(x)
+ #Use the unevaluated atom here, because some flags might have gone
+ #lost during evaluation.
+ required_flags = atom.unevaluated_atom.use.required
+ missing_iuse = pkg.iuse.get_missing_iuse(required_flags)
mreasons = []
if missing_iuse:
@@ -2264,7 +2262,9 @@ class depgraph(object):
elif unmasked_iuse_reasons:
masked_with_iuse = False
for pkg in masked_pkg_instances:
- if not pkg.iuse.get_missing_iuse(atom.use.required):
+ #Use atom.unevaluated here, because some flags might have gone
+ #lost during evaluation.
+ if not pkg.iuse.get_missing_iuse(atom.unevaluated_atom.use.required):
# Package(s) with required IUSE are masked,
# so display a normal masking message.
masked_with_iuse = True
@@ -2747,14 +2747,7 @@ class depgraph(object):
found_available_arg = True
if atom.use:
- missing_iuse = []
- for x in pkg.iuse.get_missing_iuse(atom.use.required):
- #FIXME: If a use flag occures more then it might be possible that
- #one has a default one doesn't.
- if x not in atom.use.missing_enabled and \
- x not in atom.use.missing_disabled:
- missing_iuse.append(x)
- if missing_iuse:
+ if pkg.iuse.get_missing_iuse(atom.use.required):
# Don't add this to packages_with_invalid_use_config
# since IUSE cannot be adjusted by the user.
continue
@@ -2780,6 +2773,12 @@ class depgraph(object):
if not pkg.built:
packages_with_invalid_use_config.append(pkg)
continue
+ elif atom.unevaluated_atom.use:
+ #Make sure we don't miss a 'missing IUSE'.
+ if pkg.iuse.get_missing_iuse(atom.unevaluated_atom.use.required):
+ # Don't add this to packages_with_invalid_use_config
+ # since IUSE cannot be adjusted by the user.
+ continue
#check REQUIRED_USE constraints
if not pkg.built and pkg.metadata["REQUIRED_USE"] and \
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index b1d08e267..f0d7e0190 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -684,11 +684,7 @@ class _use_dep(object):
if not isinstance(self.tokens, tuple):
self.tokens = tuple(self.tokens)
- self.required = frozenset(chain(
- enabled_flags,
- disabled_flags,
- *conditional.values()
- ))
+ self.required = frozenset(no_default)
self.enabled = frozenset(enabled_flags)
self.disabled = frozenset(disabled_flags)
@@ -782,10 +778,8 @@ class _use_dep(object):
else:
tokens.append(x)
- required = chain(enabled_flags, disabled_flags)
-
return _use_dep(tokens, enabled_flags=enabled_flags, disabled_flags=disabled_flags, \
- missing_enabled=self.missing_enabled, missing_disabled=self.missing_disabled, required=required)
+ missing_enabled=self.missing_enabled, missing_disabled=self.missing_disabled, required=self.required)
def violated_conditionals(self, other_use, is_valid_flag, parent_use=None):
"""
@@ -897,15 +891,9 @@ class _use_dep(object):
tokens.append(x)
conditional.setdefault("disabled", set()).add(flag)
- required = frozenset(chain(
- enabled_flags,
- disabled_flags,
- *conditional.values()
- ))
-
return _use_dep(tokens, enabled_flags=enabled_flags, disabled_flags=disabled_flags, \
missing_enabled=self.missing_enabled, missing_disabled=self.missing_disabled, \
- conditional=conditional, required=required)
+ conditional=conditional, required=self.required)
def _eval_qa_conditionals(self, use_mask, use_force):
"""
@@ -958,10 +946,8 @@ class _use_dep(object):
else:
tokens.append(x)
- required = chain(enabled_flags, disabled_flags)
-
return _use_dep(tokens, enabled_flags=enabled_flags, disabled_flags=disabled_flags, \
- missing_enabled=missing_enabled, missing_disabled=missing_disabled, required=required)
+ missing_enabled=missing_enabled, missing_disabled=missing_disabled, required=self.required)
if sys.hexversion < 0x3000000:
_atom_base = unicode