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>
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index f4522ed..49e41e5 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -193,16 +193,20 @@
FILE=$(basename $archive)
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)"
rm -f tarballs/$FILE
cd tarballs
wget --no-check-certificate -q $archive
+ wgetret=$?
cd ..
compute_sum $FILE
- )
+ fi
+
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
fi
printf "\n"