1 |
On 12/18/2016 07:44 AM, Brian Dolbec wrote: |
2 |
> On Sun, 18 Dec 2016 05:58:45 -0800 |
3 |
> Zac Medico <zmedico@g.o> wrote: |
4 |
> |
5 |
>> Report packages that need to be rebuilt in order to solve slot |
6 |
>> conflicts, but cannot be rebuilt for some reason. The following |
7 |
>> reasons will be detected: |
8 |
>> |
9 |
>> * matched by --exclude argument |
10 |
>> * matched by --useoldpkg-atoms argument |
11 |
>> * ebuild is masked or unavailable |
12 |
>> |
13 |
>> Example output: |
14 |
>> |
15 |
>> !!! The slot conflict(s) shown above involve package(s) which may |
16 |
>> need to !!! be rebuilt in order to solve the conflict(s). However, |
17 |
>> the following !!! package(s) cannot be rebuilt for the reasons shown: |
18 |
>> |
19 |
>> (sys-apps/less-480:0/0::gentoo, installed): ebuild is masked or |
20 |
>> unavailable |
21 |
>> |
22 |
>> X-Gentoo-bug: 602964 |
23 |
>> X-Gentoo-bug-url: https://bugs.gentoo.org/602964 |
24 |
>> --- |
25 |
>> pym/_emerge/resolver/slot_collision.py | 37 |
26 |
>> ++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), |
27 |
>> 2 deletions(-) |
28 |
>> |
29 |
>> diff --git a/pym/_emerge/resolver/slot_collision.py |
30 |
>> b/pym/_emerge/resolver/slot_collision.py index cfb5885..64147c9 100644 |
31 |
>> --- a/pym/_emerge/resolver/slot_collision.py |
32 |
>> +++ b/pym/_emerge/resolver/slot_collision.py |
33 |
>> @@ -241,6 +241,8 @@ class slot_conflict_handler(object): |
34 |
>> Print all slot conflicts in a human readable way. |
35 |
>> """ |
36 |
>> _pkg_use_enabled = self.depgraph._pkg_use_enabled |
37 |
>> + usepkgonly = "--usepkgonly" in self.myopts |
38 |
>> + need_rebuild = {} |
39 |
>> verboseconflicts = "--verbose-conflicts" in |
40 |
>> self.myopts any_omitted_parents = False |
41 |
>> msg = self.conflict_msg |
42 |
>> @@ -394,6 +396,29 @@ class slot_conflict_handler(object): |
43 |
>> selected_for_display.update( |
44 |
>> best_matches.values()) |
45 |
>> elif type in |
46 |
>> ("soname", "slot"): |
47 |
>> + # Check for |
48 |
>> packages that might need to |
49 |
>> + # be |
50 |
>> rebuilt, but cannot be rebuilt for |
51 |
>> + # some |
52 |
>> reason. |
53 |
>> + for ppkg, |
54 |
>> atom, other_pkg in parents: |
55 |
>> + if |
56 |
>> not ppkg.installed: |
57 |
>> + |
58 |
>> continue |
59 |
>> + if |
60 |
>> not (atom.soname or atom.slot_operator_built): |
61 |
>> + |
62 |
>> continue |
63 |
>> + if |
64 |
>> self.depgraph._frozen_config.excluded_pkgs.findAtomForPackage(ppkg, |
65 |
>> + |
66 |
>> modified_use=self.depgraph._pkg_use_enabled(ppkg)): |
67 |
>> + |
68 |
>> selected_for_display.add((ppkg, atom)) |
69 |
>> + |
70 |
>> need_rebuild[ppkg] = 'matched by --exclude argument' |
71 |
>> + elif |
72 |
>> self.depgraph._frozen_config.useoldpkg_atoms.findAtomForPackage(ppkg, |
73 |
>> + |
74 |
>> modified_use=self.depgraph._pkg_use_enabled(ppkg)): |
75 |
>> + |
76 |
>> selected_for_display.add((ppkg, atom)) |
77 |
>> + |
78 |
>> need_rebuild[ppkg] = 'matched by --useoldpkg-atoms argument' |
79 |
>> + elif |
80 |
>> usepkgonly: |
81 |
>> + |
82 |
>> # This case is tricky, so keep quiet in order to avoid |
83 |
>> false-positives. |
84 |
>> + |
85 |
>> pass |
86 |
>> + elif |
87 |
>> not self.depgraph._equiv_ebuild_visible(ppkg): |
88 |
>> + |
89 |
>> selected_for_display.add((ppkg, atom)) |
90 |
>> + |
91 |
>> need_rebuild[ppkg] = 'ebuild is masked or unavailable' + |
92 |
>> for ppkg, |
93 |
>> atom, other_pkg in parents: selected_for_display.add((ppkg, atom)) |
94 |
>> if |
95 |
>> not verboseconflicts: @@ -611,10 +636,18 @@ class |
96 |
>> slot_conflict_handler(object): msg.append(colorize("INFORM", |
97 |
>> "NOTE: Use the '--verbose-conflicts'" |
98 |
>> " option to display parents omitted |
99 |
>> above")) |
100 |
>> - msg.append("\n\n") |
101 |
>> - else: |
102 |
>> msg.append("\n") |
103 |
>> |
104 |
>> + if need_rebuild: |
105 |
>> + msg.append("\n!!! The slot conflict(s) shown |
106 |
>> above involve package(s) which may need to\n") |
107 |
>> + msg.append("!!! be rebuilt in order to solve |
108 |
>> the conflict(s). However, the following\n") |
109 |
>> + msg.append("!!! package(s) cannot be rebuilt |
110 |
>> for the reason(s) shown:\n\n") |
111 |
>> + for ppkg, reason in need_rebuild.items(): |
112 |
>> + msg.append("%s%s: %s\n" % (indent, |
113 |
>> ppkg, reason)) |
114 |
>> + msg.append("\n") |
115 |
>> + |
116 |
>> + msg.append("\n") |
117 |
>> + |
118 |
>> def get_explanation(self): |
119 |
>> msg = "" |
120 |
>> |
121 |
> |
122 |
> Looks good, but did you stay up all night? |
123 |
|
124 |
Yeah I took an early-evening nap and then found myself up all night. |
125 |
|
126 |
Pushed: |
127 |
|
128 |
https://gitweb.gentoo.org/proj/portage.git/commit/?id=ddbe020d9385f8b70e4ec6f085d3afa7271949d7 |
129 |
-- |
130 |
Thanks, |
131 |
Zac |