From 5f12253791c98898477d20d04b6ef4e13493eb90 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 10 Apr 2018 15:03:23 -0500 Subject: [PATCH] live-build/functions: Help developers resolve snap download issues --- live-build/functions | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/live-build/functions b/live-build/functions index 04fc25dd..cea6e042 100644 --- a/live-build/functions +++ b/live-build/functions @@ -380,11 +380,21 @@ _snap_preseed() { local assertions_dir="$seed_dir/assertions" # Download the snap & assertion + local snap_download_failed=0 chroot $CHROOT_ROOT sh -c " set -x; cd /var/lib/snapd/seed; SNAPPY_STORE_NO_CDN=1 snap download \ - --channel=$CHANNEL \"$SNAP_NAME\"" + --channel=$CHANNEL \"$SNAP_NAME\"" || snap_download_failed=1 + if [ $snap_download_failed = 1 ] ; then + echo "If the channel ($CHANNEL) includes '*/ubuntu-##.##' track per " + echo "Ubuntu policy (ex. stable/ubuntu-18.04) the publisher will need " + echo "to temporarily create the channel/track to allow fallback during" + echo "download (ex. stable/ubuntu-18.04 falls back to stable if the" + echo "prior had been created in the past)." + exit 1 + fi + mv -v $seed_dir/*.assert $assertions_dir mv -v $seed_dir/*.snap $snaps_dir