aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-12-18 04:39:59 -0800
committerZac Medico <zmedico@gentoo.org>2016-12-18 20:53:27 -0800
commitddbe020d9385f8b70e4ec6f085d3afa7271949d7 (patch)
tree1e4f60a250d11436e64d24c2314a3a4cc173f273
parentman: emaint typo fix, bug 575178 (diff)
downloadportage-ddbe020d9385f8b70e4ec6f085d3afa7271949d7.tar.gz
portage-ddbe020d9385f8b70e4ec6f085d3afa7271949d7.tar.bz2
portage-ddbe020d9385f8b70e4ec6f085d3afa7271949d7.zip
slot_conflict_handler: report packages that can't be rebuilt (bug 602964)
Report packages that need to be rebuilt in order to solve slot conflicts, but cannot be rebuilt for some reason. The following reasons will be detected: * matched by --exclude argument * matched by --useoldpkg-atoms argument * ebuild is masked or unavailable Example output: !!! The slot conflict(s) shown above involve package(s) which may need to !!! be rebuilt in order to solve the conflict(s). However, the following !!! package(s) cannot be rebuilt for the reasons shown: (sys-apps/less-480:0/0::gentoo, installed): ebuild is masked or unavailable X-Gentoo-bug: 602964 X-Gentoo-bug-url: https://bugs.gentoo.org/602964 Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/_emerge/resolver/slot_collision.py37
1 files changed, 35 insertions, 2 deletions
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index cfb588596..f676b38c8 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -241,6 +241,8 @@ class slot_conflict_handler(object):
Print all slot conflicts in a human readable way.
"""
_pkg_use_enabled = self.depgraph._pkg_use_enabled
+ usepkgonly = "--usepkgonly" in self.myopts
+ need_rebuild = {}
verboseconflicts = "--verbose-conflicts" in self.myopts
any_omitted_parents = False
msg = self.conflict_msg
@@ -394,6 +396,29 @@ class slot_conflict_handler(object):
selected_for_display.update(
best_matches.values())
elif type in ("soname", "slot"):
+ # Check for packages that might need to
+ # be rebuilt, but cannot be rebuilt for
+ # some reason.
+ for ppkg, atom, other_pkg in parents:
+ if not (isinstance(ppkg, Package) and ppkg.installed):
+ continue
+ if not (atom.soname or atom.slot_operator_built):
+ continue
+ if self.depgraph._frozen_config.excluded_pkgs.findAtomForPackage(ppkg,
+ modified_use=self.depgraph._pkg_use_enabled(ppkg)):
+ selected_for_display.add((ppkg, atom))
+ need_rebuild[ppkg] = 'matched by --exclude argument'
+ elif self.depgraph._frozen_config.useoldpkg_atoms.findAtomForPackage(ppkg,
+ modified_use=self.depgraph._pkg_use_enabled(ppkg)):
+ selected_for_display.add((ppkg, atom))
+ need_rebuild[ppkg] = 'matched by --useoldpkg-atoms argument'
+ elif usepkgonly:
+ # This case is tricky, so keep quiet in order to avoid false-positives.
+ pass
+ elif not self.depgraph._equiv_ebuild_visible(ppkg):
+ selected_for_display.add((ppkg, atom))
+ need_rebuild[ppkg] = 'ebuild is masked or unavailable'
+
for ppkg, atom, other_pkg in parents:
selected_for_display.add((ppkg, atom))
if not verboseconflicts:
@@ -611,10 +636,18 @@ class slot_conflict_handler(object):
msg.append(colorize("INFORM",
"NOTE: Use the '--verbose-conflicts'"
" option to display parents omitted above"))
- msg.append("\n\n")
- else:
msg.append("\n")
+ if need_rebuild:
+ msg.append("\n!!! The slot conflict(s) shown above involve package(s) which may need to\n")
+ msg.append("!!! be rebuilt in order to solve the conflict(s). However, the following\n")
+ msg.append("!!! package(s) cannot be rebuilt for the reason(s) shown:\n\n")
+ for ppkg, reason in need_rebuild.items():
+ msg.append("%s%s: %s\n" % (indent, ppkg, reason))
+ msg.append("\n")
+
+ msg.append("\n")
+
def get_explanation(self):
msg = ""