From: W. Trevor King Date: Thu, 13 Feb 2014 23:11:30 +0000 (-0800) Subject: build.sh: Die with an error if a wget fails X-Git-Url: http://git.tremily.us/?p=dockerfile.git;a=commitdiff_plain;h=b430db8187bf4a843fe9a218be40d70cc1151e04 build.sh: Die with an error if a wget fails --- diff --git a/build.sh b/build.sh index a291782..30286f7 100755 --- a/build.sh +++ b/build.sh @@ -110,7 +110,8 @@ import_stage3() for FILE in "${STAGE3}" "${STAGE3_CONTENTS}" "${STAGE3_DIGESTS}"; do if [ ! -f "downloads/${FILE}" ]; then - wget -O "downloads/${FILE}" "${ARCH_URL}${FILE}" + wget -O "downloads/${FILE}" "${ARCH_URL}${FILE}" || + die "failed to download ${ARCH_URL}${FILE}" fi done @@ -144,7 +145,8 @@ import_portage() for FILE in "${PORTAGE}" "${PORTAGE_SIG}"; do if [ ! -f "downloads/${FILE}" ]; then - wget -O "downloads/${FILE}" "${PORTAGE_URL}${FILE}" + wget -O "downloads/${FILE}" "${PORTAGE_URL}${FILE}" || + die "failed to download ${PORTAGE_URL}${FILE}" fi done