get_real_flag: handls use-dep default bug #446666
authorZac Medico <zmedico@gentoo.org>
Mon, 10 Dec 2012 00:26:14 +0000 (16:26 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 10 Dec 2012 00:26:14 +0000 (16:26 -0800)
pym/_emerge/Package.py
pym/_emerge/depgraph.py
pym/_emerge/resolver/slot_collision.py

index 86ed5f788f3583e6f497db1bbcde21c5fafb0e54..e19b78444c61bc44bd798cf9fb2195152ea16fd7 100644 (file)
@@ -642,6 +642,10 @@ class Package(Task):
                        return missing_iuse
 
                def get_real_flag(self, flag):
+                       """
+                       Returns the flag's name within the scope of this package
+                       (accounting for aliases), or None if the flag is unknown.
+                       """
                        if flag in self.all:
                                return flag
                        elif flag in self.all_aliases:
@@ -649,8 +653,7 @@ class Package(Task):
                                        if flag in v:
                                                return k
                        else:
-                               raise ValueError("'%s' flag is not in IUSE and is not an alias of any flag in IUSE of '%s::%s'" %
-                                       (flag, self._pkg.cpv, self._pkg.repo))
+                               return None
 
        def __len__(self):
                return 4
index 568a116828f0f6f9b110e0799e67cdad391a6910..3cd44dd4e930f2252474e4dd56ed746addc91e95 100644 (file)
@@ -4109,6 +4109,9 @@ class depgraph(object):
 
                for flag, state in target_use.items():
                        real_flag = pkg.iuse.get_real_flag(flag)
+                       if real_flag is None:
+                               # Triggered by use-dep defaults.
+                               continue
                        if state:
                                if real_flag not in old_use:
                                        if new_changes.get(real_flag) == False:
index e04166b81d440f83453c1124f321cc2b67681a50..8b2f4b888a62b1bc7617b17fd521d3c41ebcf5a2 100644 (file)
@@ -226,6 +226,9 @@ class slot_conflict_handler(object):
                for pkg in solution:
                        for flag, state in solution[pkg].items():
                                real_flag = pkg.iuse.get_real_flag(flag)
+                               if real_flag is None:
+                                       # Triggered by use-dep defaults.
+                                       continue
                                if state == "enabled" and flag not in _pkg_use_enabled(pkg):
                                        new_change.setdefault(pkg, {})[real_flag] = True
                                elif state == "disabled" and flag in _pkg_use_enabled(pkg):