buildgcc: Show the exit status of wget if downloading fails.

Change-Id: Ie3a44c6db9c9c186c52b4743334266ec5411ba8a
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11472
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
zbao 2015-08-30 23:35:16 -04:00 committed by Zheng Bao
parent ff3f15cd4d
commit d22b9ea1cb
1 changed files with 7 additions and 3 deletions

View File

@ -193,16 +193,20 @@ download() {
FILE=$(basename $archive) FILE=$(basename $archive)
printf " * $FILE " printf " * $FILE "
test -f tarballs/$FILE && check_sum $FILE && printf "(cached)" || ( if test -f tarballs/$FILE && check_sum $FILE ; then
printf "(cached)"
else
printf "(downloading from $archive)" printf "(downloading from $archive)"
rm -f tarballs/$FILE rm -f tarballs/$FILE
cd tarballs cd tarballs
wget --no-check-certificate -q $archive wget --no-check-certificate -q $archive
wgetret=$?
cd .. cd ..
compute_sum $FILE compute_sum $FILE
) fi
if [ ! -f tarballs/$FILE ]; then if [ ! -f tarballs/$FILE ]; then
printf "\n${RED}Failed to download $FILE.${NC}\n" printf "\n${RED}Failed to download $FILE. Wget returns $wgetret. See 'man wget'.${NC}\n"
exit 1 exit 1
fi fi
printf "\n" printf "\n"