rm -f ${LFS_PKG_DIR}/${PACK}.${arch_ext}
${WGETCMD} ${URL}/${PACK}.${arch_ext}
+ wget_status=$?
# Failure: if it was a connection timeout, don't try for other file extensions.
if grep "failed: Connection timed out" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
continue;
fi
- # If we arrive here, it means we were able to download the file.
+ if [ ${wget_status} -ne 0 ]; then
+ echo "Error fetching package ${PACK}.${arch_ext}"
+ return 1
+ fi
+
+ # If we arrive here, it means we were able to successfully download the file.
if [ "x${arch_ext}" = "xtar.gz" -o "x${arch_ext}" = "xtgz" -o "x${arch_ext}" = "xtar.Z" ]; then
gztobz2 ${LFS_PKG_DIR}/${PACK}.${arch_ext}
fi