Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/
Date: Thu, 22 Sep 2011 02:02:55
Message-Id: 8111f07162a14674484fa3bbb21550cb927818ad.zmedico@gentoo
1 commit: 8111f07162a14674484fa3bbb21550cb927818ad
2 Author: Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
3 AuthorDate: Thu Sep 22 01:59:17 2011 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 22 01:59:17 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8111f071
7
8 Warn about ignored binary packages with non matching USE
9
10 ---
11 pym/_emerge/depgraph.py | 47 ++++++++++++++++++++++++++++++++++++++++++++---
12 1 files changed, 44 insertions(+), 3 deletions(-)
13
14 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
15 index 8121f68..b10efd6 100644
16 --- a/pym/_emerge/depgraph.py
17 +++ b/pym/_emerge/depgraph.py
18 @@ -389,6 +389,11 @@ class _dynamic_depgraph_config(object):
19 self._ignored_deps = []
20 self._highest_pkg_cache = {}
21
22 + # Binary packages that have been rejected because their USE
23 + # didn't match the user's config. It maps packages to a set
24 + # of flags causing the rejection.
25 + self.ignored_binaries = {}
26 +
27 self._needed_unstable_keywords = backtrack_parameters.needed_unstable_keywords
28 self._needed_p_mask_changes = backtrack_parameters.needed_p_mask_changes
29 self._needed_license_changes = backtrack_parameters.needed_license_changes
30 @@ -540,6 +545,38 @@ class depgraph(object):
31 if self._frozen_config.spinner:
32 self._frozen_config.spinner.update()
33
34 + def _show_ignored_binaries(self):
35 + """
36 + Show binaries that have been ignored becaue their USE didn't
37 + match the user's config.
38 + """
39 + if not self._dynamic_config.ignored_binaries \
40 + or '--quiet' in self._frozen_config.myopts:
41 + return
42 +
43 + self._show_merge_list()
44 +
45 + writemsg("\n!!! The following binary packages have been ignored " + \
46 + "due to non matching USE:\n\n", noiselevel=-1)
47 +
48 + for pkg, flags in self._dynamic_config.ignored_binaries.items():
49 + writemsg(" =%s" % pkg.cpv, noiselevel=-1)
50 + if pkg.root != '/':
51 + writemsg(" for %s" % (pkg.root,), noiselevel=-1)
52 + writemsg("\n use flag(s): %s\n" % ", ".join(sorted(flags)),
53 + noiselevel=-1)
54 +
55 + msg = [
56 + "",
57 + "NOTE: The --binpkg-respect-use=n option will prevent emerge",
58 + " from ignoring these binary packages if possible."
59 + ]
60 +
61 + for line in msg:
62 + if line:
63 + line = colorize("INFORM", line)
64 + writemsg_stdout(line + "\n", noiselevel=-1)
65 +
66 def _show_missed_update(self):
67
68 # In order to minimize noise, show only the highest
69 @@ -3942,9 +3979,11 @@ class depgraph(object):
70 cur_iuse = iuses
71 if myeb and not usepkgonly and not useoldpkg:
72 cur_iuse = myeb.iuse.all
73 - if self._reinstall_for_flags(forced_flags,
74 - old_use, iuses,
75 - now_use, cur_iuse):
76 + reinstall_for_flags = self._reinstall_for_flags(forced_flags,
77 + old_use, iuses, now_use, cur_iuse)
78 + if reinstall_for_flags:
79 + if not pkg.installed:
80 + self._dynamic_config.ignored_binaries.setdefault(pkg, set()).update(reinstall_for_flags)
81 break
82 # Compare current config to installed package
83 # and do not reinstall if possible.
84 @@ -6125,6 +6164,8 @@ class depgraph(object):
85 else:
86 self._show_missed_update()
87
88 + self._show_ignored_binaries()
89 +
90 self._display_autounmask()
91
92 # TODO: Add generic support for "set problem" handlers so that