From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1538416-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 6A84115800A
	for <garchives@archives.gentoo.org>; Tue, 18 Jul 2023 06:28:28 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A22F5E08CD;
	Tue, 18 Jul 2023 06:28:27 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 8C5D4E08CD
	for <gentoo-commits@lists.gentoo.org>; Tue, 18 Jul 2023 06:28:27 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id A3179340D8B
	for <gentoo-commits@lists.gentoo.org>; Tue, 18 Jul 2023 06:28:26 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E846AAFD
	for <gentoo-commits@lists.gentoo.org>; Tue, 18 Jul 2023 06:28:24 +0000 (UTC)
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" <grobian@gentoo.org>
Message-ID: <1689614995.360d18ba7cfbbd285f5ed6d97892778685b8a106.grobian@gentoo>
Subject: [gentoo-commits] proj/portage-utils:master commit in: /
X-VCS-Repository: proj/portage-utils
X-VCS-Files: main.c
X-VCS-Directories: /
X-VCS-Committer: grobian
X-VCS-Committer-Name: Fabian Groffen
X-VCS-Revision: 360d18ba7cfbbd285f5ed6d97892778685b8a106
X-VCS-Branch: master
Date: Tue, 18 Jul 2023 06:28:24 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 9d43ac67-0d37-4507-8769-3aa69d55f55b
X-Archives-Hash: 64c68c26e8a0edfee237d429f75f52f8

commit:     360d18ba7cfbbd285f5ed6d97892778685b8a106
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 17 17:29:55 2023 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Jul 17 17:29:55 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=360d18ba

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 <AT> gentoo.org>

 main.c | 11 ++++++++---
 1 file 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);