aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-08-16 12:08:32 +0200
committerMichał Górny <mgorny@gentoo.org>2017-08-17 09:30:08 +0200
commita62ebb4a2f759da85aaab7a214c3f8c4ac7f4d64 (patch)
tree4e27392ceeddb982abaa1eac253b9e651aa03d38
parentquickpkg: handle unsuccessful compressor exit in quickpkg_atom (diff)
downloadportage-a62ebb4a2f759da85aaab7a214c3f8c4ac7f4d64.tar.gz
portage-a62ebb4a2f759da85aaab7a214c3f8c4ac7f4d64.tar.bz2
portage-a62ebb4a2f759da85aaab7a214c3f8c4ac7f4d64.zip
elog mod_echo: Print log path if PORT_LOGDIR is used
Include the path to the log file if PORT_LOGDIR is being used (and therefore the log is going to be preserved past the build). This is useful when elog messages contain QA warnings or other errors that require reporting a bug. In such case, having a path to the log is handy. After this commit, the mod_echo output becomes: * Messages for package dev-foo/bar-1: * Log file: /var/log/portage/dev-foo:bar-1:20170816-100533.log * test Reviewed-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/portage/elog/mod_echo.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pym/portage/elog/mod_echo.py b/pym/portage/elog/mod_echo.py
index f9cc53788..bb34a1e44 100644
--- a/pym/portage/elog/mod_echo.py
+++ b/pym/portage/elog/mod_echo.py
@@ -1,5 +1,5 @@
# elog/mod_echo.py - elog dispatch module
-# Copyright 2007-2014 Gentoo Foundation
+# Copyright 2007-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -16,7 +16,12 @@ if sys.hexversion >= 0x3000000:
_items = []
def process(mysettings, key, logentries, fulltext):
global _items
- _items.append((mysettings["ROOT"], key, logentries))
+ logfile = None
+ # output logfile explicitly only if it isn't in tempdir, otherwise
+ # it will be removed anyway
+ if "PORT_LOGDIR" in mysettings:
+ logfile = mysettings["PORTAGE_LOG_FILE"]
+ _items.append((mysettings["ROOT"], key, logentries, logfile))
def finalize():
# For consistency, send all message types to stdout.
@@ -34,7 +39,7 @@ def finalize():
def _finalize():
global _items
printer = EOutput()
- for root, key, logentries in _items:
+ for root, key, logentries, logfile in _items:
print()
if root == "/":
printer.einfo(_("Messages for package %s:") %
@@ -42,6 +47,8 @@ def _finalize():
else:
printer.einfo(_("Messages for package %(pkg)s merged to %(root)s:") %
{"pkg": colorize("INFORM", key), "root": root})
+ if logfile is not None:
+ printer.einfo(_("Log file: %s") % colorize("INFORM", logfile))
print()
for phase in EBUILD_PHASES:
if phase not in logentries: