- if detect_file_not_found; then
- # If file was not found, maybe a .tar.gz file exist...
- ${WGETCMD} ${URL}/${PACK}.tar.gz
- if [ ${?} -eq 0 ]; then
- gztobz2 ${LFS_PKG_DIR}/${PACK}.tar.gz || return 1
- return 0
- else
- if detect_file_not_found; then
- # If file was not found, maybe a .tgz file exist...
- ${WGETCMD} ${URL}/${PACK}.tgz
- if [ ${?} -eq 0 ]; then
- gztobz2 ${LFS_PKG_DIR}/${PACK}.tgz || return 1
- return 0
- else
- if detect_file_not_found; then
- # If file was not found, maybe a .tar.Z file exist... (uw-imap...)
- ${WGETCMD} ${URL}/${PACK}.tar.Z
- if [ ${?} -eq 0 ]; then
- gztobz2 ${LFS_PKG_DIR}/${PACK}.tar.Z || return 1
- return 0
- fi
- fi
- fi
- fi
+ for arch_ext in ${ARCH_EXT}; do
+ ${WGETCMD} ${URL}/${PACK}.${arch_ext}
+
+ # 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
+ echo "Error, wget reported: Connection timed out"
+ return 1