Regle la pluspart des problemes avec fpkg et wget
[hvlinux.git] / functions-update
index 2f2359f..90ba606 100644 (file)
@@ -227,6 +227,7 @@ static_getpkg()
         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
@@ -239,7 +240,12 @@ static_getpkg()
             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