From: root Date: Wed, 9 Dec 2009 07:17:28 +0000 (+0000) Subject: Fixed error when downloading unavailable bz2 package (failover to gz) X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=bb0a16c7b69f42327f9ae0b8c40cfa35fd34aba2;p=hvlinux.git Fixed error when downloading unavailable bz2 package (failover to gz) --- diff --git a/functions-update b/functions-update index 4c67529..fd458f2 100644 --- a/functions-update +++ b/functions-update @@ -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