aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/disk-image-builder/ubuntu
diff options
context:
space:
mode:
authorCarsten Koester <ckoester@cisco.com>2016-06-11 16:12:05 -0400
committerDave Wallace <dwallacelf@gmail.com>2016-06-19 02:08:56 +0000
commit025d95939e2c14658204b307420fc75656a90ca7 (patch)
tree39ad3d695b2e70c32ccd3f8307440ff65e0e41c8 /resources/tools/disk-image-builder/ubuntu
parentd60c62fdcf6d088b7a2769ebfc25d42154864878 (diff)
CSIT-154: Fetch superseded Ubuntu packages using Launchpad API
Change-Id: I0db121d7f2b227e62240941b026b58fcd233a129 Signed-off-by: Carsten Koester <ckoester@cisco.com>
Diffstat (limited to 'resources/tools/disk-image-builder/ubuntu')
-rwxr-xr-xresources/tools/disk-image-builder/ubuntu/build.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/resources/tools/disk-image-builder/ubuntu/build.sh b/resources/tools/disk-image-builder/ubuntu/build.sh
index c94f445801..33634adf02 100755
--- a/resources/tools/disk-image-builder/ubuntu/build.sh
+++ b/resources/tools/disk-image-builder/ubuntu/build.sh
@@ -192,6 +192,9 @@ unzip -n ${PACKER_DIR}/packer*zip -d ${PACKER_DIR}
## APT
+# This seems to be where Ubuntu keeps superseded versions of packages
+LAUNCHPAD_URL='https://launchpad.net/ubuntu/+archive/primary/+files/'
+
rm -fr ${OUTPUT_DIR}
mkdir -p ${OUTPUT_DIR}/temp/deb
mkdir -p ${APT_CACHE_DIR}
@@ -202,11 +205,16 @@ do
# Download if not already present
if [ ! -f ${APT_CACHE_DIR}/$name ]
then
- wget -P ${APT_CACHE_DIR} -O ${APT_CACHE_DIR}/$name ${url//\'}
+ if ! wget -P ${APT_CACHE_DIR} -O ${APT_CACHE_DIR}/$name ${url//\'}
+ then
+ echo "WARNING: Unable to get package using previously recorded URL, may"
+ echo " be superseded. Trying launchpad instead."
+ wget -P ${APT_CACHE_DIR} -O ${APT_CACHE_DIR}/$name "${LAUNCHPAD_URL}${name}"
+ fi
fi
# Verify checksum (always -- regardless of whether the package was
- # just downloaded, or already tehere
+ # just downloaded, or was already there
actual_md5sum=$(${MD5UTIL} < ${APT_CACHE_DIR}/$name)
if [ ! "${actual_md5sum:0:32}" = "${checksum:7}" ]
then