extract_affecting_use: less strict for installed
authorZac Medico <zmedico@gentoo.org>
Tue, 21 Jun 2011 07:57:59 +0000 (00:57 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 21 Jun 2011 07:57:59 +0000 (00:57 -0700)
pym/_emerge/depgraph.py
pym/_emerge/resolver/circular_dependency.py

index 80409b0d3383536692eefe47778401d1ca0a44ea..c22215ba21fb8eead343882bc769ad9bc86495fa 100644 (file)
@@ -2668,8 +2668,12 @@ class depgraph(object):
 
                                affecting_use = set()
                                for dep_str in dep_strings:
-                                       affecting_use.update(extract_affecting_use(dep_str, atom,
-                                               eapi=node.metadata["EAPI"]))
+                                       try:
+                                               affecting_use.update(extract_affecting_use(
+                                                       dep_str, atom, eapi=node.metadata["EAPI"]))
+                                       except InvalidDependString:
+                                               if not node.installed:
+                                                       raise
 
                                #Don't show flags as 'affecting' if the user can't change them,
                                affecting_use.difference_update(node.use.mask, \
index 08dd5c55fcc302515aa8731bd25ad06bd60e2e8a..aabc174f27272a4fe28fba7ae58f3fe25179b654 100644 (file)
@@ -6,6 +6,7 @@ from __future__ import print_function
 from itertools import chain
 
 from portage.dep import use_reduce, extract_affecting_use, check_required_use, get_required_use_flags
+from portage.exception import InvalidDependString
 from portage.output import colorize
 from _emerge.DepPrioritySatisfiedRange import DepPrioritySatisfiedRange
 
@@ -112,8 +113,13 @@ class circular_dependency_handler(object):
                                        parent_atom = atom.unevaluated_atom
                                        break
 
-                       affecting_use = extract_affecting_use(dep, parent_atom,
-                               eapi=parent.metadata["EAPI"])
+                       try:
+                               affecting_use = extract_affecting_use(dep, parent_atom,
+                                       eapi=parent.metadata["EAPI"])
+                       except InvalidDependString:
+                               if not parent.installed:
+                                       raise
+                               affecting_use = set()
 
                        # Make sure we don't want to change a flag that is 
                        #       a) in use.mask or use.force