From f89f610f2f662d7260dd4b0511419868798f6aa1 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Wed, 11 Nov 2009 20:22:58 +0000 Subject: [PATCH] Merged from trunk -r14781:14803 | 14782 | Collapse two [[ ]] into one. | | zmedico | | | 14783 | Bug #291200 - Add a --quiet-build option to redirect all | | zmedico | build output to logs alone, and do not display it on stdout. | | 14784 | Use writemsg instead of print, to send debug messages to | | zmedico | stderr. | | 14798 | Fix typo in comment. | | zmedico | | | 14802 | When displaying masking messages, show the 'dependency | | zmedico | required by' message before the masking docs message. | | 14803 | Make split-elog bold. | | zmedico | | svn path=/main/branches/prefix/; revision=14811 --- bin/ebuild.sh | 2 +- man/emerge.1 | 4 ++++ man/make.conf.5 | 2 +- pym/_emerge/Scheduler.py | 3 ++- pym/_emerge/depgraph.py | 23 ++++++++++++++++------- pym/_emerge/help.py | 6 ++++++ pym/_emerge/main.py | 4 +++- 7 files changed, 33 insertions(+), 11 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 899f98e81..91f75c030 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1828,7 +1828,7 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then # interaction begins. unset DEPEND RDEPEND PDEPEND IUSE - if [[ $PORTAGE_DEBUG != 1 ]] || [[ ${-/x/} != $- ]] ; then + if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then source "$EBUILD" || die "error sourcing ebuild" else set -x diff --git a/man/emerge.1 b/man/emerge.1 index 0035102ba..b1d5e6752 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -471,6 +471,10 @@ b blocked by another package (automatically resolved conflict) Results may vary, but the general outcome is a reduced or condensed output from portage's displays. .TP +.BR \-\-quiet\-build +Redirect all build output to logs alone, and do not +display it on stdout. +.TP .BR "\-\-reinstall changed\-use" Tells emerge to include installed packages where USE flags have changed since installation. Unlike \fB\-\-newuse\fR, this option does diff --git a/man/make.conf.5 b/man/make.conf.5 index b9e5c516d..d22c43cd7 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -392,7 +392,7 @@ a read-only NFS share. A read-only \fBDISTDIR\fR is not compatible with the \fBFEATURES\fR in order to avoid warning messages that are triggered by this incompatibility. .TP -split\-elog +.B split\-elog Store logs created by \fBPORTAGE_ELOG_SYSTEM="save"\fR in category subdirectories of \fBPORT_LOGDIR/elog\fR, instead of using \fBPORT_LOGDIR/elog\fR directly. diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index f969f7105..1f37a5f0c 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -294,7 +294,8 @@ class Scheduler(PollScheduler): @returns: True if background mode is enabled, False otherwise. """ background = (self._max_jobs is True or \ - self._max_jobs > 1 or "--quiet" in self.myopts) and \ + self._max_jobs > 1 or "--quiet" in self.myopts \ + or "--quiet-build" in self.myopts) and \ not bool(self._opts_no_background.intersection(self.myopts)) if background: diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index ef8233684..8b83cf724 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -1133,10 +1133,12 @@ class depgraph(object): if not dep_string: continue if debug: - print() - print("Parent: ", jbigkey) - print("Depstring:", dep_string) - print("Priority:", dep_priority) + writemsg_level("\nParent: %s\n" % (pkg,), + noiselevel=-1, level=logging.DEBUG) + writemsg_level("Depstring: %s\n" % (dep_string,), + noiselevel=-1, level=logging.DEBUG) + writemsg_level("Priority: %s\n" % (dep_priority,), + noiselevel=-1, level=logging.DEBUG) try: @@ -1272,7 +1274,8 @@ class depgraph(object): return 0 if debug: - print("Exiting...", pkg) + writemsg_level("Exiting... %s\n" % (pkg,), + noiselevel=-1, level=logging.DEBUG) return 1 @@ -1340,7 +1343,7 @@ class depgraph(object): atom_pkg_graph.remove(pkg) # Yield < and <= atoms first, since those are more likely to - # cause a slot conflicts, and we want those atoms to be displayed + # cause slot conflicts, and we want those atoms to be displayed # in the resulting slot conflict message (see bug #291142). less_than = [] not_less_than = [] @@ -2193,6 +2196,8 @@ class depgraph(object): else: show_missing_use = unmasked_iuse_reasons + mask_docs = False + if show_missing_use: print("\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+".") print("!!! One of the following packages is required to complete your request:") @@ -2216,7 +2221,7 @@ class depgraph(object): for line in wrap(msg, 75): print(line) print() - show_mask_docs() + mask_docs = True else: print("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".") @@ -2251,6 +2256,10 @@ class depgraph(object): print() + if mask_docs: + show_mask_docs() + print() + def _iter_match_pkgs(self, root_config, pkg_type, atom, onlydeps=False): """ Iterate over Package instances of pkg_type matching the given atom. diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py index 422442fb4..82f0666c8 100644 --- a/pym/_emerge/help.py +++ b/pym/_emerge/help.py @@ -497,6 +497,12 @@ def help(myopts, havecolor=1): print(" Effects vary, but the general outcome is a reduced or condensed") print(" output from portage's displays.") print() + print(" "+green("--quiet-build")) + desc = "Redirect all build output to logs alone, and do not " + \ + "display it on stdout." + for line in wrap(desc, desc_width): + print(desc_indent + line) + print() print(" "+green("--reinstall ") + turquoise("changed-use")) print(" Tells emerge to include installed packages where USE flags have") print(" changed since installation. Unlike --newuse, this option does") diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index b73dc0900..461b7060f 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -64,7 +64,9 @@ options=[ "--nodeps", "--noreplace", "--nospinner", "--oneshot", "--onlydeps", "--pretend", -"--quiet", "--resume", +"--quiet", +"--quiet-build", +"--resume", "--searchdesc", "--skipfirst", "--tree", -- 2.26.2