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.
sil2100/appliance-images
Robert C Jennings 5 years ago
parent b8865cb17d
commit 15c419eafb
No known key found for this signature in database
GPG Key ID: 740C3D9EEDF2ED73

6
debian/changelog vendored

@ -1,3 +1,9 @@
livecd-rootfs (2.525.42) UNRELEASED; urgency=medium
* Fix core_snap variable scope issue
-- Robert C Jennings <robert.jennings@canonical.com> Fri, 28 Feb 2020 08:29:57 -0600
livecd-rootfs (2.525.41) bionic; urgency=medium livecd-rootfs (2.525.41) bionic; urgency=medium
* Use snap cli rather than custom snap-tool (LP: #1864252) * Use snap cli rather than custom snap-tool (LP: #1864252)

@ -440,6 +440,7 @@ _snap_preseed() {
fi fi
# Pre-seed snap's base # Pre-seed snap's base
local core_snap=""
case $SNAP_NAME in case $SNAP_NAME in
snapd) snapd)
# snapd is self-contained, ignore base # snapd is self-contained, ignore base
@ -458,7 +459,7 @@ _snap_preseed() {
exit 1 exit 1
fi 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' # If snap info does not list a base use 'core'
core_snap=${core_snap:-core} core_snap=${core_snap:-core}

Loading…
Cancel
Save