From d54fbed5b538cca5986e783c271cfd9cf679198d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 25 Aug 2010 20:12:13 -0700 Subject: 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. --- pym/_emerge/depgraph.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'pym/_emerge/depgraph.py') 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" % \ -- cgit v1.2.3-1-g7c22