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
# Options:
# -e File extension (default is tar.bz2)
# -d Fetch directory (default is LFS_PKG_DIR)
-# -f Filename (default is PACKAGE)
+# -f Filename on server (default is PACKAGE)
# -h Display this help and returns
# -s Subdirectory on server
fpkg()