summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-03-14 10:52:17 -0700
committerZac Medico <zmedico@gentoo.org>2011-03-14 10:52:17 -0700
commit9bdc01a9ef0c5c6373a4a4ac5ad288dc9018372c (patch)
tree952192e1da94427430f14a6e039720941fba2ced
parentUpdate timestamps in headers of modified files. (diff)
downloadportage-2.2.0_alpha27.tar.gz
portage-2.2.0_alpha27.tar.bz2
portage-2.2.0_alpha27.zip
emerge: support [ y | n ] for --quietv2.2.0_alpha27
This allows --quiet and --quiet-build to be enabled via EMERGE_DEFAULT_OPTS, and then temporarily disabled via the command- line.
-rw-r--r--man/emerge.16
-rw-r--r--pym/_emerge/help.py7
-rw-r--r--pym/_emerge/main.py29
3 files changed, 34 insertions, 8 deletions
diff --git a/man/emerge.1 b/man/emerge.1
index 42bd39822..0e3eb1312 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Feb 2011" "Portage VERSION" "Portage"
+.TH "EMERGE" "1" "Mar 2011" "Portage VERSION" "Portage"
.SH "NAME"
emerge \- Command\-line interface to the Portage system
.SH "SYNOPSIS"
@@ -514,11 +514,11 @@ B blocked by another package (unresolved conflict)
b blocked by another package (automatically resolved conflict)
.TE
.TP
-.BR "\-\-quiet " (\fB\-q\fR)
+.BR "\-\-quiet [ y | n ] (\-q short option)"
Results may vary, but the general outcome is a reduced or condensed
output from portage's displays.
.TP
-.BR \-\-quiet\-build
+.BR "\-\-quiet\-build [ y | n ]"
Redirect all build output to logs alone, and do not
display it on stdout.
.TP
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 2f8b342cd..020bc4206 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -578,11 +578,14 @@ def help(myopts, havecolor=1):
print(" printed out accompanied by a '+' for enabled and a '-' for")
print(" disabled USE flags.")
print()
- print(" "+green("--quiet")+" ("+green("-q")+" short option)")
+ print(" " + green("--quiet") + \
+ " [ %s | %s ] (%s short option)" % \
+ (turquoise("y"), turquoise("n"), green("-q")))
print(" Effects vary, but the general outcome is a reduced or condensed")
print(" output from portage's displays.")
print()
- print(" "+green("--quiet-build"))
+ print(" " + green("--quiet-build") + \
+ " [ %s | %s ]" % (turquoise("y"), turquoise("n")))
desc = "Redirect all build output to logs alone, and do not " + \
"display it on stdout."
for line in wrap(desc, desc_width):
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index fb75ba999..f061ae41f 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -65,8 +65,6 @@ options=[
"--nodeps", "--noreplace",
"--nospinner", "--oneshot",
"--onlydeps", "--pretend",
-"--quiet",
-"--quiet-build",
"--quiet-unmerge-warn",
"--resume",
"--searchdesc",
@@ -91,7 +89,6 @@ shortmapping={
"n":"--noreplace", "N":"--newuse",
"o":"--onlydeps", "O":"--nodeps",
"p":"--pretend", "P":"--prune",
-"q":"--quiet",
"r":"--resume",
"s":"--search", "S":"--searchdesc",
"t":"--tree",
@@ -437,6 +434,8 @@ def insert_optional_args(args):
'--jobs' : valid_integers,
'--keep-going' : y_or_n,
'--package-moves' : y_or_n,
+ '--quiet' : y_or_n,
+ '--quiet-build' : y_or_n,
'--rebuilt-binaries' : y_or_n,
'--root-deps' : ('rdeps',),
'--select' : y_or_n,
@@ -462,6 +461,7 @@ def insert_optional_args(args):
'G' : y_or_n,
'k' : y_or_n,
'K' : y_or_n,
+ 'q' : y_or_n,
}
arg_stack = args[:]
@@ -697,6 +697,19 @@ def parse_opts(tmpcmdline, silent=False):
"choices" : true_y_or_n
},
+ "--quiet": {
+ "shortopt" : "-q",
+ "help" : "reduced or condensed output",
+ "type" : "choice",
+ "choices" : true_y_or_n
+ },
+
+ "--quiet-build": {
+ "help" : "redirect build output to logs",
+ "type" : "choice",
+ "choices" : true_y_or_n
+ },
+
"--rebuilt-binaries": {
"help" : "replace installed packages with binary " + \
"packages that have been rebuilt",
@@ -869,6 +882,16 @@ def parse_opts(tmpcmdline, silent=False):
if myoptions.package_moves in true_y:
myoptions.package_moves = True
+ if myoptions.quiet in true_y:
+ myoptions.quiet = True
+ else:
+ myoptions.quiet = None
+
+ if myoptions.quiet_build in true_y:
+ myoptions.quiet_build = True
+ else:
+ myoptions.quiet_build = None
+
if myoptions.rebuilt_binaries in true_y:
myoptions.rebuilt_binaries = True