Try to fetch missing packages from hugovil.com
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 22 Dec 2014 06:15:43 +0000 (01:15 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Sat, 27 Dec 2014 05:01:52 +0000 (00:01 -0500)
functions/fpkg

index 7be2960..ee290c5 100644 (file)
@@ -338,35 +338,50 @@ static_getpkg()
         PREFERRED_EXT="${DEFAULT_ARCH_EXT_LIST}"
     fi
 
-    for arch_ext in ${PREFERRED_EXT}; do
-        wget_wrapper ${URL} ${PACK}.${arch_ext}
-        wget_wrapper_status=$?
+    wget_wrapper_status=
+    url_list="${URL}"
 
-        if [ ${wget_wrapper_status} -eq 1 ]; then
-            return 1;
-        fi
+    if [ x"${URL}" != x"${HV_PACKAGES_URL}" ]; then
+        url_list+=" ${HV_PACKAGES_URL}"
+    fi
 
-        if [ ${wget_wrapper_status} -eq 2 ]; then
-            continue;
-        fi
+    for url in ${url_list}; do
+        for arch_ext in ${PREFERRED_EXT}; do
+            wget_wrapper ${url} ${PACK}.${arch_ext}
+            wget_wrapper_status=$?
 
-        # If we are here, it means the file was successfully downloaded.
-        FINAL_EXT=${arch_ext}
+            #if [ ${wget_wrapper_status} -eq 1 ]; then
+            #    return 1;
+            #fi
 
-        # Convert to bzip2 format if requested and if it is a tar/gz archive
-        if [ -n "${PREFER_BZIP2_ARCHIVE}" ]; then
-            if is_extension_tar_gzip "${arch_ext}" ; then
-                rcmd "Converting ${PACK}.${arch_ext} to bzip2 format" \
-                    gztobz2 ${LFS_PKG_DIR}/${PACK}.${arch_ext}
-                FINAL_EXT="tar.bz2"
+            if [ ${wget_wrapper_status} -eq 0 ]; then
+                break;
             fi
-        fi
+        done
 
-        return $?
+        if [ ${wget_wrapper_status} -eq 0 ]; then
+            break;
+        fi
     done
 
     # Failure or file not found
-    return 1
+    if [ ${wget_wrapper_status} -gt 0 ]; then
+        return 1;
+    fi
+
+    # If we are here, it means the file was successfully downloaded.
+    FINAL_EXT=${arch_ext}
+
+    # Convert to bzip2 format if requested and if it is a tar/gz archive
+    if [ -n "${PREFER_BZIP2_ARCHIVE}" ]; then
+        if is_extension_tar_gzip "${arch_ext}" ; then
+            rcmd "Converting ${PACK}.${arch_ext} to bzip2 format" \
+                 gztobz2 ${LFS_PKG_DIR}/${PACK}.${arch_ext}
+            FINAL_EXT="tar.bz2"
+        fi
+    fi
+
+    return 0
 }
 
 # Test integrity of archive