aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2023-07-17 19:29:55 +0200
committerFabian Groffen <grobian@gentoo.org>2023-07-17 19:29:55 +0200
commit360d18ba7cfbbd285f5ed6d97892778685b8a106 (patch)
tree11485683987b06a3f1153c7bb59b18c31758914d
parentmain: silence repo warnings when quiet is set (diff)
downloadportage-utils-360d18ba7cfbbd285f5ed6d97892778685b8a106.tar.gz
portage-utils-360d18ba7cfbbd285f5ed6d97892778685b8a106.tar.bz2
portage-utils-360d18ba7cfbbd285f5ed6d97892778685b8a106.zip
initialize_portage_env: init color and quiet defaults early
profile init code may use warn etc so ensure we have colours defined and quiet setup via fallback Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r--main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/main.c b/main.c
index 6ebb9e2..010675e 100644
--- a/main.c
+++ b/main.c
@@ -979,6 +979,14 @@ initialize_portage_env(void)
const char *configroot = getenv("PORTAGE_CONFIGROOT");
char *primary_overlay = NULL;
+ /* ensure color strings are initialised, code below here may use
+ * e.g. warn which uses them */
+ color_clear();
+
+ /* set quiet early in the game, bug #735134 */
+ if (getenv("PORTAGE_QUIET") != NULL)
+ setup_quiet();
+
/* initialize all the properties with their default value */
for (i = 0; vars_to_read[i].name; ++i) {
var = &vars_to_read[i];
@@ -1221,9 +1229,6 @@ initialize_portage_env(void)
}
}
- if (getenv("PORTAGE_QUIET") != NULL)
- setup_quiet();
-
if (nocolor) {
color_clear();
setenv("NOCOLOR", "true", 1);