summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-15 08:58:05 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-15 08:58:05 +0000
commit3228fd7b4de8d850b3c943fc84fb61ae8bc715eb (patch)
treeafd9291c104a4fb5c6ad60a88b1bc496db66b7fd
parenta4cad6c46f6aa40f9a1683259407485d1dc82c13 (diff)
downloadportage-3228fd7b4de8d850b3c943fc84fb61ae8bc715eb.tar.gz
portage-3228fd7b4de8d850b3c943fc84fb61ae8bc715eb.tar.bz2
portage-3228fd7b4de8d850b3c943fc84fb61ae8bc715eb.zip
When there is more than one failure, show a summary packages that failed to
build or install. This is especially useful when using --jobs or --keep-going since there can be multiple failures. svn path=/main/trunk/; revision=11055
-rw-r--r--pym/_emerge/__init__.py39
1 files changed, 31 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 7fd2c2764..786824790 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -8390,6 +8390,7 @@ class Scheduler(PollScheduler):
self._pkg_queue = []
self._completed_tasks = set()
self._failed_pkgs = []
+ self._failed_pkgs_all = []
self._failed_fetches = []
self._parallel_fetch = False
merge_count = len([x for x in mergelist \
@@ -8813,6 +8814,7 @@ class Scheduler(PollScheduler):
for failed_pkg, returncode in failed_pkgs:
mergelist.remove(list(failed_pkg))
+ self._failed_pkgs_all.extend(failed_pkgs)
del failed_pkgs[:]
if not mergelist:
@@ -8845,6 +8847,22 @@ class Scheduler(PollScheduler):
self._logger.log(" *** Finished. Cleaning up...")
+ if len(self._failed_pkgs_all) > 1:
+ _flush_elog_mod_echo()
+ msg = "The following packages have " + \
+ "failed to build or install:"
+ prefix = bad(" * ")
+ writemsg(prefix + "\n", noiselevel=-1)
+ from textwrap import wrap
+ for line in wrap(msg, 72):
+ writemsg("%s%s\n" % (prefix, line), noiselevel=-1)
+ writemsg(prefix + "\n", noiselevel=-1)
+ for pkg, returncode in self._failed_pkgs_all:
+ writemsg("%s\t%s\n" % (prefix,
+ colorize("INFORM", str(pkg))),
+ noiselevel=-1)
+ writemsg(prefix + "\n", noiselevel=-1)
+
return rval
def _add_packages(self):
@@ -9883,6 +9901,18 @@ def display_news_notification(trees):
print "Use " + colorize("GOOD", "eselect news") + " to read news items."
print
+def _flush_elog_mod_echo():
+ """
+ Dump the mod_echo output now so that our other
+ notifications are shown last.
+ """
+ try:
+ from portage.elog import mod_echo
+ except ImportError:
+ pass # happens during downgrade to a version without the module
+ else:
+ mod_echo.finalize()
+
def post_emerge(trees, mtimedb, retval):
"""
Misc. things to run at the end of a merge session.
@@ -9929,14 +9959,7 @@ def post_emerge(trees, mtimedb, retval):
exit_msg = " *** exiting unsuccessfully with status '%s'." % retval
emergelog("notitles" not in settings.features, exit_msg)
- # Dump the mod_echo output now so that our other notifications are shown
- # last.
- try:
- from portage.elog import mod_echo
- except ImportError:
- pass # happens during downgrade to a version without the module
- else:
- mod_echo.finalize()
+ _flush_elog_mod_echo()
vdb_path = os.path.join(target_root, portage.VDB_PATH)
portage.util.ensure_dirs(vdb_path)