Fix default use match for implicit IUSE. v2.2.0_alpha159
authorZac Medico <zmedico@gentoo.org>
Mon, 21 Jan 2013 21:30:13 +0000 (13:30 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 21 Jan 2013 21:30:13 +0000 (13:30 -0800)
This will fix bug #453400, which was triggered by inconsistency
between the enabled USE and the effective missing_disabled set used
in matching logic, due to implicit IUSE.

pym/_emerge/depgraph.py
pym/portage/dbapi/__init__.py
pym/portage/dep/__init__.py

index 7a967957c1f64debafb873c96bf8fb642e1c624c..73ee3e9828e990fdcdbe60ba046c7bdcf12b8c91 100644 (file)
@@ -4418,8 +4418,11 @@ class depgraph(object):
 
                                                use_match = True
                                                can_adjust_use = not pkg.built
-                                               missing_enabled = atom.use.missing_enabled.difference(pkg.iuse.all)
-                                               missing_disabled = atom.use.missing_disabled.difference(pkg.iuse.all)
+                                               is_valid_flag = pkg.iuse.is_valid_flag
+                                               missing_enabled = frozenset(x for x in
+                                                       atom.use.missing_enabled if not is_valid_flag(x))
+                                               missing_disabled = frozenset(x for x in
+                                                       atom.use.missing_disabled if not is_valid_flag(x))
 
                                                if atom.use.enabled:
                                                        if any(x in atom.use.enabled for x in missing_disabled):
index 5828bcacd88434597b43ecb423f6b27eaf7c47f0..3540c6dc6023f537decf6c3245d694090f5d7d65 100644 (file)
@@ -220,8 +220,12 @@ class dbapi(object):
                        # data corruption).
                        use = frozenset(x for x in metadata["USE"].split()
                                if x in iuse or iuse_implicit_match(x))
-                       missing_enabled = atom.use.missing_enabled.difference(iuse)
-                       missing_disabled = atom.use.missing_disabled.difference(iuse)
+                       missing_enabled = frozenset(x for x in
+                               atom.use.missing_enabled if not
+                               (x in iuse or iuse_implicit_match(x)))
+                       missing_disabled = frozenset(x for x in
+                               atom.use.missing_disabled if not
+                               (x in iuse or iuse_implicit_match(x)))
 
                        if atom.use.enabled:
                                if any(x in atom.use.enabled for x in missing_disabled):
@@ -258,11 +262,15 @@ class dbapi(object):
 
                        # Check unsatisfied use-default deps
                        if atom.use.enabled:
-                               missing_disabled = atom.use.missing_disabled.difference(iuse)
+                               missing_disabled = frozenset(x for x in
+                                       atom.use.missing_disabled if not
+                                       (x in iuse or iuse_implicit_match(x)))
                                if any(x in atom.use.enabled for x in missing_disabled):
                                        return False
                        if atom.use.disabled:
-                               missing_enabled = atom.use.missing_enabled.difference(iuse)
+                               missing_enabled = frozenset(x for x in
+                                       atom.use.missing_enabled if not
+                                       (x in iuse or iuse_implicit_match(x)))
                                if any(x in atom.use.disabled for x in missing_enabled):
                                        return False
 
index 511753116d81f6890bff0d3db9e7715f01897a86..1edbab76fea451ecbb9f303e9a5acde03bfa1fab 100644 (file)
@@ -2282,9 +2282,11 @@ def match_from_list(mydep, candidate_list):
                                        continue
 
                                if mydep.use:
-
-                                       missing_enabled = mydep.use.missing_enabled.difference(x.iuse.all)
-                                       missing_disabled = mydep.use.missing_disabled.difference(x.iuse.all)
+                                       is_valid_flag = x.iuse.is_valid_flag
+                                       missing_enabled = frozenset(flag for flag in
+                                               mydep.use.missing_enabled if not is_valid_flag(flag))
+                                       missing_disabled = frozenset(flag for flag in
+                                               mydep.use.missing_disabled if not is_valid_flag(flag))
 
                                        if mydep.use.enabled:
                                                if any(f in mydep.use.enabled for f in missing_disabled):