From: Zac Medico Date: Thu, 29 Nov 2012 07:52:49 +0000 (-0800) Subject: emerge: add --quiet-fail for bug #440982 X-Git-Tag: v2.2.0_alpha143~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c74a19691f5cbc0ec070d5fd4ffe1983bde05a09;p=portage.git emerge: add --quiet-fail for bug #440982 --- diff --git a/man/emerge.1 b/man/emerge.1 index a6c20a99d..850a2414b 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -1,4 +1,4 @@ -.TH "EMERGE" "1" "Oct 2012" "Portage VERSION" "Portage" +.TH "EMERGE" "1" "Nov 2012" "Portage VERSION" "Portage" .SH "NAME" emerge \- Command\-line interface to the Portage system .SH "SYNOPSIS" @@ -635,7 +635,8 @@ output from portage's displays. .BR "\-\-quiet\-build [ y | n ]" Redirect all build output to logs alone, and do not display it on stdout. If a build failure occurs for a single package, the build -log will be automatically displayed on stdout. If there are multiple +log will be automatically displayed on stdout (unless the +\fI\-\-quiet\-fail\fR option is enabled). If there are multiple build failures (due to options like \-\-keep\-going or \-\-jobs), then the content of the log files will not be displayed, and instead the paths of the log files will be displayed together with the @@ -644,6 +645,12 @@ Note that interactive packages currently force all build output to be displayed on stdout. This issue can be temporarily avoided by specifying \fI\-\-accept\-properties=\-interactive\fR. .TP +.BR "\-\-quiet\-fail [ y | n ]" +Suppresses display of the build log on stdout when build output is hidden +due to options such as \fI\-\-jobs\fR, \fI\-\-quiet\fR, or +\fI\-\-quiet\-build\fR. Only the die message and the path of the build log +will be displayed on stdout. +.TP .BR "\-\-quiet\-repo\-display" In the package merge list display, suppress ::repository output, and instead use numbers to indicate which repositories package come from. diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 708af12c6..6a494970e 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -1065,7 +1065,8 @@ class Scheduler(PollScheduler): printer = portage.output.EOutput() background = self._background failure_log_shown = False - if background and len(self._failed_pkgs_all) == 1: + if background and len(self._failed_pkgs_all) == 1 and \ + self.myopts.get('--quiet-fail', 'n') != 'y': # If only one package failed then just show it's # whole log for easy viewing. failed_pkg = self._failed_pkgs_all[-1] diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index be5a5cad4..cdadbecf4 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -139,6 +139,7 @@ def insert_optional_args(args): '--package-moves' : y_or_n, '--quiet' : y_or_n, '--quiet-build' : y_or_n, + '--quiet-fail' : y_or_n, '--rebuild-if-new-slot': y_or_n, '--rebuild-if-new-rev' : y_or_n, '--rebuild-if-new-ver' : y_or_n, @@ -541,6 +542,12 @@ def parse_opts(tmpcmdline, silent=False): "choices" : true_y_or_n, }, + "--quiet-fail": { + "help" : "suppresses display of the build log on stdout", + "type" : "choice", + "choices" : true_y_or_n, + }, + "--rebuild-if-new-slot": { "help" : ("Automatically rebuild or reinstall packages when slot/sub-slot := " "operator dependencies can be satisfied by a newer slot, so that " @@ -782,6 +789,9 @@ def parse_opts(tmpcmdline, silent=False): if myoptions.quiet_build in true_y: myoptions.quiet_build = 'y' + if myoptions.quiet_fail in true_y: + myoptions.quiet_fail = 'y' + if myoptions.rebuild_if_new_slot in true_y: myoptions.rebuild_if_new_slot = 'y'