Fixed error when downloading unavailable bz2 package (failover to gz)
authorroot <root@364a67c3-989e-7be9-548d-dae8560ea662>
Wed, 9 Dec 2009 07:17:28 +0000 (07:17 +0000)
committerroot <root@364a67c3-989e-7be9-548d-dae8560ea662>
Wed, 9 Dec 2009 07:17:28 +0000 (07:17 +0000)
functions-update

index 4c67529..fd458f2 100644 (file)
@@ -155,7 +155,7 @@ detect_file_not_found()
 {
     # HTTP: will return error code 404.
     # FTP: will say "File not found"
-    if grep "404 Not Found" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
+    if grep "404" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
         return 0
     elif grep "No such file" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
         return 0
@@ -189,6 +189,7 @@ static_getpkg()
     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
@@ -402,14 +403,14 @@ lpkg()
 
     if [ ! -h ${LFS_PKG_DIR}/${FILE} ]; then
        # The link does not exist. First check if source file exist.
-       if [ ! -f ${LFS_PKG_BASE}/${SRCSTAGE}/${FILE} ]; then
-           echo "${FUNCNAME} ${*}"
-           echo "Missing source file..."
-           exit 1
-       fi
+       #if [ ! -f ${LFS_PKG_BASE}/${SRCSTAGE}/${FILE} ]; then
+       #    echo "${FUNCNAME} ${*}"
+       #    echo "Missing source file..."
+       #    return 1
+       #fi
 
        # Create link if it doesn't exist
-       ln -s ../${SRCSTAGE}/${FILE} ${LFS_PKG_DIR}/${FILE}
+       action_checkbox_time "Linking ${PACKAGE_NAME}" ln -s ../${SRCSTAGE}/${FILE} ${LFS_PKG_DIR}/${FILE}
     fi
 
     # Create link for patches corresponding to that package:
@@ -418,7 +419,7 @@ lpkg()
            PATCHFILE=$(basename ${patch})
            if [ ! -h ${LFS_PKG_DIR}/${PATCHFILE} ]; then
                # Create link if it doesn't exist
-               ln -s ../${SRCSTAGE}/${PATCHFILE} ${LFS_PKG_DIR}/${PATCHFILE}
+               action_checkbox_time "Linking ${PACKAGE_NAME}" ln -s ../${SRCSTAGE}/${PATCHFILE} ${LFS_PKG_DIR}/${PATCHFILE}
            fi
        done
     fi