mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-13 22:28:27 +00:00
Backport error-checking on determining snap bases
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1828500 Signed-off-by: Iain Lane <iain.lane@canonical.com>
This commit is contained in:
parent
f77a1b26cf
commit
51ef72e5b9
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
||||
livecd-rootfs (2.525.28) bionic; urgency=medium
|
||||
|
||||
[ Tobias Koch ]
|
||||
* Do proper error checking when calling snap-tool info to determine
|
||||
the base of a snap. (LP: #1828500)
|
||||
|
||||
-- Tobias Koch <tobias.koch@canonical.com> Tue, 16 Jul 2019 11:27:10 +0200
|
||||
|
||||
livecd-rootfs (2.525.27) bionic; urgency=medium
|
||||
|
||||
* Backport improvements to snap seeding from trunk. LP: #1831675.
|
||||
|
@ -445,12 +445,20 @@ _snap_preseed() {
|
||||
;;
|
||||
*)
|
||||
# Determine if and what core snap is needed
|
||||
local core_snap=$(/usr/share/livecd-rootfs/snap-tool info \
|
||||
local snap_info
|
||||
|
||||
snap_info=$(/usr/share/livecd-rootfs/snap-tool info \
|
||||
--cohort-key="${COHORT_KEY:-}" \
|
||||
--channel="$CHANNEL" "$SNAP_NAME" | \
|
||||
grep '^base:' | awk '{print $2}'
|
||||
--channel="$CHANNEL" "${SNAP_NAME}" \
|
||||
)
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to retrieve base of $SNAP_NAME!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local core_snap=$(echo "$snap_info" | grep '^base:' | awk '{print $2}')
|
||||
|
||||
# If $core_snap is not the empty string then SNAP itself is not a core
|
||||
# snap and we must additionally seed the core snap.
|
||||
if [ -n "$core_snap" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user