From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 164E115800F for ; Wed, 22 Feb 2023 16:21:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 549CBE07AE; Wed, 22 Feb 2023 16:21:52 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 36A69E077A for ; Wed, 22 Feb 2023 16:21:52 +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 45DAE33BF36 for ; Wed, 22 Feb 2023 16:21:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B58B18B6 for ; Wed, 22 Feb 2023 16:21:49 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1677082675.991727070a928a03481303ed5b0a571534853445.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: scripts/ X-VCS-Repository: repo/gentoo X-VCS-Files: scripts/bootstrap.sh X-VCS-Directories: scripts/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 991727070a928a03481303ed5b0a571534853445 X-VCS-Branch: master Date: Wed, 22 Feb 2023 16:21:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ee914c57-da1e-4bfd-8f49-8921886974c0 X-Archives-Hash: 7f1871dbd1868c7f45a1fa6cf5c83112 commit: 991727070a928a03481303ed5b0a571534853445 Author: Krzesimir Nowak microsoft com> AuthorDate: Wed Feb 15 10:14:30 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Feb 22 16:17:55 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99172707 scripts/bootstrap.sh: Fix bootstrap in verbose mode Verbose mode does not unset STRAP_RUN, thus the script tries to prune sys-devel/gcc at the later stage. Currently portage exits with an exit status 1 if a specific package was requested to be pruned and there was nothing to do. This results in a bootstrap failure. So before we try to prune, let's do a dry run to see if anything would be done. For the portage code that results in exit status 1, see the following link: https://gitweb.gentoo.org/proj/portage.git/tree/lib/_emerge/actions.py?id=bde2a895cf520687dce7a8e92601041a37529ba0#n1700 Signed-off-by: Krzesimir Nowak microsoft.com> Closes: https://github.com/gentoo/gentoo/pull/29612 Signed-off-by: Sam James gentoo.org> scripts/bootstrap.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 4e6b87af15a4..1e998075691a 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -345,10 +345,16 @@ fi if [[ -n ${STRAP_RUN} ]] ; then if [[ -x ${GCC_CONFIG} ]] && ${GCC_CONFIG} --get-current-profile &>/dev/null then - # Make sure we get the old gcc unmerged ... - ${V_ECHO} emerge ${STRAP_EMERGE_OPTS} --prune sys-devel/gcc || cleanup 1 - # Make sure the profile and /lib/cpp and /usr/bin/cc are valid ... - ${GCC_CONFIG} "$(${GCC_CONFIG} --get-current-profile)" &>/dev/null + output=$(${V_ECHO} emerge ${STRAP_EMERGE_OPTS} --prune --pretend --quiet sys-devel/gcc 2>/dev/null) + if [[ ${DEBUG} = "1" ]] ; then + echo "${output}" + fi + if [[ "${output}" = *'All selected packages:'* ]] ; then + # Make sure we get the old gcc unmerged ... + ${V_ECHO} emerge ${STRAP_EMERGE_OPTS} --prune sys-devel/gcc || cleanup 1 + # Make sure the profile and /lib/cpp and /usr/bin/cc are valid ... + ${GCC_CONFIG} "$(${GCC_CONFIG} --get-current-profile)" &>/dev/null + fi fi fi