From 200bde50cc48f2386cf389132d116df2b71cdc8d Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Wed, 24 Jan 2024 17:58:46 +0000 Subject: [PATCH] fix: `return 0` instead of `return` if the intent is not to exit build If the previous if statement checking if PASSES_TO_LAYERS is true, then the last return code be non-zero and a return statement with no argument will return the error code of the if statement thus exiting the script. This is not our intent. So we need to return 0 here when layer name as already been registered --- debian/changelog | 7 +++++++ live-build/auto/config | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 54763960..73971b55 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (24.04.21) noble; urgency=medium + + * Do not exit live image build if PASSES_TO_LAYERS is true and layer + is already registered. + + -- Philip Roche Wed, 24 Jan 2024 17:59:06 +0000 + livecd-rootfs (24.04.20) noble; urgency=medium * fix: Fix for calling unminimize if lxd-installer package diff --git a/live-build/auto/config b/live-build/auto/config index 0f02d37f..5729fae7 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -109,7 +109,13 @@ _register_pass () { case "$PASSES" in *$1*) - return + # The pass is already registered in the list of layers. + # If PASSES_TO_LAYERS is true, then the above if statement's error + # code will be non-zero and a return statement with no argument + # will return the error code of the if statement, non-zero, thus + # exiting the script and build. This is not our intent. So we need + # to return 0 here. + return 0 ;; esac