From: Zac Medico Date: Mon, 10 Dec 2012 00:26:14 +0000 (-0800) Subject: get_real_flag: handls use-dep default bug #446666 X-Git-Tag: v2.2.0_alpha146~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ecae0c4fc46d6bc8054104a99af90bc45d4e7429;p=portage.git get_real_flag: handls use-dep default bug #446666 --- diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 86ed5f788..e19b78444 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -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 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 568a11682..3cd44dd4e 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -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: diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py index e04166b81..8b2f4b888 100644 --- a/pym/_emerge/resolver/slot_collision.py +++ b/pym/_emerge/resolver/slot_collision.py @@ -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):