From 6d88618b9ea50782aac29f0fcdb19f387d81f526 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 4 Jan 2022 15:06:03 +0100 Subject: [PATCH] Make sure test-this-branch.sh exits if distro-info is not installed Although the script is running with -e, having two distinct invocations of a subshell in the same instruction masks failures in the first subshell invocation. It is similar in essence to what the pipefail option controls. As a consequence, the following instruction does not fail if distro-info is not installed: isoname=$(distro-info -d)-live-server-$(dpkg --print-architecture).iso And therefore, we end up with something like: isoname=-live-server-amd64.iso Fixed by first assigning the value of $(distro-info -d) to a variable. Signed-off-by: Olivier Gayot --- scripts/test-this-branch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/test-this-branch.sh b/scripts/test-this-branch.sh index 3cb98440..f272732f 100755 --- a/scripts/test-this-branch.sh +++ b/scripts/test-this-branch.sh @@ -8,7 +8,8 @@ sudo apt install -y zsync xorriso isolinux snapcraft snap --output subiquity_test.snap urlbase=http://cdimage.ubuntu.com/ubuntu-server/daily-live/current -isoname=$(distro-info -d)-live-server-$(dpkg --print-architecture).iso +distroname=$(distro-info -d) +isoname="${distroname}"-live-server-$(dpkg --print-architecture).iso zsync ${urlbase}/${isoname}.zsync sudo ./scripts/inject-subiquity-snap.sh ${isoname} subiquity_test.snap custom.iso