summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/depgraph.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-25 20:12:13 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-25 20:12:13 -0700
commitd54fbed5b538cca5986e783c271cfd9cf679198d (patch)
tree7ef70f209390d79c23fd5335953c8a63e8712a03 /pym/_emerge/depgraph.py
parentd5490ca81fec08bad27414979305cc9a50c56edd (diff)
downloadportage-d54fbed5b538cca5986e783c271cfd9cf679198d.tar.gz
portage-d54fbed5b538cca5986e783c271cfd9cf679198d.tar.bz2
portage-d54fbed5b538cca5986e783c271cfd9cf679198d.zip
Bug #334365 - Mask packages with invalid metadata as early as possible,
so that the depgraph won't select them unless they are already installed and there is no other choice. This should trigger automatic reinstallation of installed packages that have invalid metadata.
Diffstat (limited to 'pym/_emerge/depgraph.py')
-rw-r--r--pym/_emerge/depgraph.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d0d5386a1..435cc1a98 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1033,16 +1033,14 @@ class depgraph(object):
# TODO: For installed package, save any InvalidDependString
# info in dynamic_config and wait until display_problems()
- # to show it. For packages that aren't installed, we should
- # validate and mask them before they are selected.
+ # to show it.
try:
dep_string = portage.dep.use_reduce(dep_string,
uselist=self._pkg_use_enabled(pkg), is_valid_flag=pkg.iuse.is_valid_flag)
except portage.exception.InvalidDependString as e:
if not pkg.installed:
- # TODO: validate and mask this before it's selected
- show_invalid_depstring_notice(pkg, dep_string, str(e))
- return 0
+ # should have been masked before it was selected
+ raise
del e
# Try again, but omit the is_valid_flag argument, since
@@ -1067,9 +1065,8 @@ class depgraph(object):
del e
continue
- # TODO: validate and mask this before it's selected
- show_invalid_depstring_notice(pkg, dep_string, str(e))
- return 0
+ # should have been masked before it was selected
+ raise
if not dep_string:
continue
@@ -1122,11 +1119,13 @@ class depgraph(object):
dep_string, myuse=self._pkg_use_enabled(pkg), parent=pkg,
strict=strict, priority=dep_priority)
except portage.exception.InvalidDependString as e:
- show_invalid_depstring_notice(pkg, dep_string, str(e))
- del e
if pkg.installed:
+ # TODO: show in display_problems()
+ show_invalid_depstring_notice(pkg, dep_string, str(e))
return 1
- return 0
+
+ # should have been masked before it was selected
+ raise
if debug:
writemsg_level("Candidates: %s\n" % \