diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-25 17:05:01 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-25 17:05:01 -0700 |
commit | 99fbc0b6720f354a722ba329d737d37e4dded8dd (patch) | |
tree | 68b8ce5e7b7f9917b77a88012e44f1e88e854b25 | |
parent | 5ca155745b2c65af4a1550c860478166a30acc10 (diff) | |
download | portage-99fbc0b6720f354a722ba329d737d37e4dded8dd.tar.gz portage-99fbc0b6720f354a722ba329d737d37e4dded8dd.tar.bz2 portage-99fbc0b6720f354a722ba329d737d37e4dded8dd.zip |
Bug #334365 - When parsing dependencies of installed packages in
depgraph._add_pkg_deps(), ignore invalid USE conditionals, since
these are a common problem and it's practical to ignore them for
installed packages.
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.
-rw-r--r-- | pym/_emerge/depgraph.py | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index b939be128..d0d5386a1 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1031,18 +1031,43 @@ class depgraph(object): writemsg_level("Priority: %s\n" % (dep_priority,), noiselevel=-1, level=logging.DEBUG) + # 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. 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 + del e + + # Try again, but omit the is_valid_flag argument, since + # invalid USE conditionals are a common problem and it's + # practical to ignore this issue for installed packages. + try: + dep_string = portage.dep.use_reduce(dep_string, + uselist=self._pkg_use_enabled(pkg)) + except portage.exception.InvalidDependString as e: + # TODO: show in display_problems() + show_invalid_depstring_notice(pkg, dep_string, str(e)) + del e + continue + try: dep_string = list(self._queue_disjunctive_deps( pkg, dep_root, dep_priority, dep_string)) - except portage.exception.InvalidDependString as e: if pkg.installed: + # TODO: show in display_problems() + show_invalid_depstring_notice(pkg, dep_string, str(e)) del e continue + + # TODO: validate and mask this before it's selected show_invalid_depstring_notice(pkg, dep_string, str(e)) return 0 |