X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fdisk-image-builder%2Fubuntu%2Fbuild.sh;h=6b1254661d0eabaa54842f3ee5062577afc7266f;hp=c94f4458012e318a0ae3ba98b548fa615e976ab4;hb=4ab17f1d485e858b885f430e8ffe0852602f31c3;hpb=9d378548cc86028c55baf17260d32d0055603b78 diff --git a/resources/tools/disk-image-builder/ubuntu/build.sh b/resources/tools/disk-image-builder/ubuntu/build.sh index c94f445801..6b1254661d 100755 --- a/resources/tools/disk-image-builder/ubuntu/build.sh +++ b/resources/tools/disk-image-builder/ubuntu/build.sh @@ -83,7 +83,7 @@ PACKER_DIR="${BUILD_DIR}/packer" APT_CACHE_DIR="${BUILD_DIR}/cache/apt" PIP_CACHE_DIR="${BUILD_DIR}/cache/pip" -PACKER_TEMPLATE="ubuntu-14.04.4.json" +PACKER_TEMPLATE="$1.json" LISTS_DIR="$(dirname $0)/lists" function syntax { @@ -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,17 @@ 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." + url_basename=$(basename $url | tr -d "'") + wget -P ${APT_CACHE_DIR} -O ${APT_CACHE_DIR}/$name "${LAUNCHPAD_URL}${url_basename}" + 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