From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 22 Oct 2025 14:29:56 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vBXyW-00AbdL-04 for lore@lore.pengutronix.de; Wed, 22 Oct 2025 14:29:56 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1vBXyV-0001jf-He; Wed, 22 Oct 2025 14:29:55 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vBXyS-0001i4-H8; Wed, 22 Oct 2025 14:29:52 +0200 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vBXyS-004tCe-11; Wed, 22 Oct 2025 14:29:52 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1vBXyS-000000010xf-18SD; Wed, 22 Oct 2025 14:29:52 +0200 From: Roland Hieber To: distrokit@pengutronix.de Date: Wed, 22 Oct 2025 14:29:11 +0200 Message-ID: <20251022122947.241881-2-rhi@pengutronix.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251022122947.241881-1-rhi@pengutronix.de> References: <20251022122947.241881-1-rhi@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH 2/3] ci-prepare: make return value safe X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roland Hieber Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false If ./selected_toolchain_r5 does not exist, [ -e selected_toolchain_r5 ] will return falsely and the script will return falsely too, failing the build. Ignore the return values by wrapping the test calls into ifs instead of relying on short-circuit. Signed-off-by: Roland Hieber --- ci-prepare | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ci-prepare b/ci-prepare index 0bb4e58664c2..14337f14e46e 100755 --- a/ci-prepare +++ b/ci-prepare @@ -3,14 +3,18 @@ # version symlinked to ./p case "${JOB_BASE_NAME}" in *v8a*) - [ -e selected_toolchain_r5 ] || { + if [ -e selected_toolchain_r5 ]; then # store away the currently selected toolchain - [ -e selected_toolchain ] && mv selected_toolchain selected_toolchain_ci_backup + if [ -e selected_toolchain ]; then + mv selected_toolchain selected_toolchain_ci_backup + fi # create toolchain based on v7a platform, which is needed for R5 processor. ./p toolchain --platformconfig=configs/platform-v7a/platformconfig mv selected_toolchain selected_toolchain_r5 # restore the selected toolchain, if there was one before - [ -e selected_toolchain_ci_backup ] && mv selected_toolchain_ci_backup selected_toolchain - } + if [ -e selected_toolchain_ci_backup ]; then + mv selected_toolchain_ci_backup selected_toolchain + fi + fi ;; esac -- 2.47.3