From 8111f07162a14674484fa3bbb21550cb927818ad Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Wed, 21 Sep 2011 18:59:17 -0700 Subject: [PATCH] Warn about ignored binary packages with non matching USE --- pym/_emerge/depgraph.py | 47 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 8121f68bc..b10efd62c 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -389,6 +389,11 @@ class _dynamic_depgraph_config(object): self._ignored_deps = [] self._highest_pkg_cache = {} + # Binary packages that have been rejected because their USE + # didn't match the user's config. It maps packages to a set + # of flags causing the rejection. + self.ignored_binaries = {} + self._needed_unstable_keywords = backtrack_parameters.needed_unstable_keywords self._needed_p_mask_changes = backtrack_parameters.needed_p_mask_changes self._needed_license_changes = backtrack_parameters.needed_license_changes @@ -540,6 +545,38 @@ class depgraph(object): if self._frozen_config.spinner: self._frozen_config.spinner.update() + def _show_ignored_binaries(self): + """ + Show binaries that have been ignored becaue their USE didn't + match the user's config. + """ + if not self._dynamic_config.ignored_binaries \ + or '--quiet' in self._frozen_config.myopts: + return + + self._show_merge_list() + + writemsg("\n!!! The following binary packages have been ignored " + \ + "due to non matching USE:\n\n", noiselevel=-1) + + for pkg, flags in self._dynamic_config.ignored_binaries.items(): + writemsg(" =%s" % pkg.cpv, noiselevel=-1) + if pkg.root != '/': + writemsg(" for %s" % (pkg.root,), noiselevel=-1) + writemsg("\n use flag(s): %s\n" % ", ".join(sorted(flags)), + noiselevel=-1) + + msg = [ + "", + "NOTE: The --binpkg-respect-use=n option will prevent emerge", + " from ignoring these binary packages if possible." + ] + + for line in msg: + if line: + line = colorize("INFORM", line) + writemsg_stdout(line + "\n", noiselevel=-1) + def _show_missed_update(self): # In order to minimize noise, show only the highest @@ -3942,9 +3979,11 @@ class depgraph(object): cur_iuse = iuses if myeb and not usepkgonly and not useoldpkg: cur_iuse = myeb.iuse.all - if self._reinstall_for_flags(forced_flags, - old_use, iuses, - now_use, cur_iuse): + reinstall_for_flags = self._reinstall_for_flags(forced_flags, + old_use, iuses, now_use, cur_iuse) + if reinstall_for_flags: + if not pkg.installed: + self._dynamic_config.ignored_binaries.setdefault(pkg, set()).update(reinstall_for_flags) break # Compare current config to installed package # and do not reinstall if possible. @@ -6125,6 +6164,8 @@ class depgraph(object): else: self._show_missed_update() + self._show_ignored_binaries() + self._display_autounmask() # TODO: Add generic support for "set problem" handlers so that -- 2.26.2