From 15c419eafba36cb9d1981f8ce4dcb7eaacb8f4e7 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Fri, 28 Feb 2020 08:29:39 -0600 Subject: [PATCH] Fix core_snap variable scope issue The prior change to pre-seed the correct base added a case to handle installation of the core snap. When that was added it created a case where the $core_snap variable would not be defined when we reach the end of the _snap_preseed function and evaluate if $core_snap is defined by empty. Previous if the snap to preseed was core or core18 then $core_snap would be "" so this patch addresses that by ensuring the variable exists and is empty by default. --- debian/changelog | 6 ++++++ live-build/functions | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 575d730d..8139f673 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.525.42) UNRELEASED; urgency=medium + + * Fix core_snap variable scope issue + + -- Robert C Jennings Fri, 28 Feb 2020 08:29:57 -0600 + livecd-rootfs (2.525.41) bionic; urgency=medium * Use snap cli rather than custom snap-tool (LP: #1864252) diff --git a/live-build/functions b/live-build/functions index 1d9a9427..17be9eb6 100644 --- a/live-build/functions +++ b/live-build/functions @@ -440,6 +440,7 @@ _snap_preseed() { fi # Pre-seed snap's base + local core_snap="" case $SNAP_NAME in snapd) # snapd is self-contained, ignore base @@ -458,7 +459,7 @@ _snap_preseed() { exit 1 fi - local core_snap=$(echo "$snap_info" | grep '^base:' | awk '{print $2}') + core_snap=$(echo "$snap_info" | grep '^base:' | awk '{print $2}') # If snap info does not list a base use 'core' core_snap=${core_snap:-core}