diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2017-11-26 23:59:42 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2017-11-26 23:59:46 -0800 |
commit | 111ea5abbac500854cd22c00dd09a9557bf001b0 (patch) | |
tree | 49b9df4d654c5d9d96c4ad1ac918901e2912bab7 /app-portage/portage-utils/files | |
parent | net-analyzer/wireshark: Fix header install (bug #638866 by Garri), configure ... (diff) | |
download | gentoo-111ea5abbac500854cd22c00dd09a9557bf001b0.tar.gz gentoo-111ea5abbac500854cd22c00dd09a9557bf001b0.tar.bz2 gentoo-111ea5abbac500854cd22c00dd09a9557bf001b0.zip |
app-portage/portage-utils: fix quietness.
Make PORTAGE_QUIET=1 actually be quiet properly.
Thanks to Zac for the suggestion of checking how PORTAGE_QUIET was being
handled.
Thanks: Zac Medico <zmedico@gentoo.org>
Closes: https://bugs.gentoo.org/635828
Package-Manager: Portage-2.3.16, Repoman-2.3.6
Diffstat (limited to 'app-portage/portage-utils/files')
-rw-r--r-- | app-portage/portage-utils/files/portage-utils-0.64-fix-quiet.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/app-portage/portage-utils/files/portage-utils-0.64-fix-quiet.patch b/app-portage/portage-utils/files/portage-utils-0.64-fix-quiet.patch new file mode 100644 index 000000000000..447fe3aa4138 --- /dev/null +++ b/app-portage/portage-utils/files/portage-utils-0.64-fix-quiet.patch @@ -0,0 +1,51 @@ +commit 237d1b34166fea2e4cb0eb28098a5b2759548b86 +Author: Robin H. Johnson <robbat2@gentoo.org> +Date: Sun Nov 26 23:50:58 2017 -0800 + + Fix PORTAGE_QUIET quiet result. + + Having PORTAGE_QUIET set caused the quiet variable to be incremented, + but it did not also setup the warnout variable. + + Add a common setup function for warnout quiet, and use consistently. + + Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> + +diff --git a/main.c b/main.c +index d124695..dea03a8 100644 +--- a/main.c ++++ b/main.c +@@ -78,6 +78,15 @@ no_colors(void) + setenv("NOCOLOR", "true", 1); + } + ++static void ++setup_quiet(void) ++{ ++ /* "e" for FD_CLOEXEC */ ++ if (quiet == 0) ++ warnout = fopen("/dev/null", "we"); ++ ++quiet; ++} ++ + /* include common applet defs */ + #include "applets.h" + +@@ -102,7 +111,7 @@ no_colors(void) + #define COMMON_GETOPTS_CASES(applet) \ + case 0x1: portroot = optarg; break; \ + case 'v': ++verbose; break; \ +- case 'q': if (quiet == 0) { warnout = fopen("/dev/null", "we"); } ++quiet; break; \ ++ case 'q': setup_quiet(); break; \ + case 'V': version_barf(); break; \ + case 'h': applet ## _usage(EXIT_SUCCESS); break; \ + case 'C': no_colors(); break; \ +@@ -952,7 +961,7 @@ initialize_portage_env(void) + xarraypush_str(overlays, main_overlay); + + if (getenv("PORTAGE_QUIET") != NULL) +- quiet = 1; ++ setup_quiet(); + + if (nocolor) + no_colors(); |