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