From 11413e8cf4335e3cd9a5c47d7c56c17d66d2e215 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Thu, 10 Mar 2011 04:34:00 +0000 Subject: [PATCH] =?utf8?q?R=C3=A9gl=C3=A9=20probl=C3=A8me=20avec=20fpkg:?= =?utf8?q?=20si=20le=20texte=20"404"=20se=20retrouvait=20dans=20le=20log?= =?utf8?q?=20de=20wget=20(exemple=20avec=20la=20taille=20du=20fichier),=20?= =?utf8?q?la=20fonction=20detect=5Ffile=5Fnot=5Ffound()=20d=C3=A9tectait?= =?utf8?q?=20une=20erreur=20de=20t=C3=A9l=C3=A9chargement=20(erreur=20HTTP?= =?utf8?q?=20404).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- config/sysinfos.amd64 | 2 +- functions/fpkg | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/config/sysinfos.amd64 b/config/sysinfos.amd64 index 8e13102..25bebd5 100644 --- a/config/sysinfos.amd64 +++ b/config/sysinfos.amd64 @@ -5,7 +5,7 @@ INST_TYPE="workstation" HVL_TARGET="x86_64" -MAKEJOBS=10 +MAKEJOBS=4 # Destination path where to install new Linux-HV system. This is usually where # you have mounted your new LFS partition, but it can also be any directory. diff --git a/functions/fpkg b/functions/fpkg index f637f54..0fd60c5 100644 --- a/functions/fpkg +++ b/functions/fpkg @@ -158,17 +158,15 @@ static_getpatch() detect_file_not_found() { - # HTTP: will return error code 404. + # HTTP: will return "ERROR 404: Not Found" # FTP: will say "File not found" - if grep "404" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then - #echo "404 NOTFOUND" + if grep --ignore-case "not found" ${WGET_LOG_FILE} \ + 1> /dev/null 2>&1; then + echo "404 NOTFOUND" return 0 - elif grep "No such file" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then - #echo "No such file" - return 0 - else - return 1 fi + + return 1 } # Get package if it is not in the repository @@ -203,7 +201,8 @@ static_getpkg() # so we can safely remove any file prior to trying to download it. rm -f ${LFS_PKG_DIR}/${PACK}.${arch_ext} - rcmd "Fetching ${PACK}.${arch_ext}" ${WGETCMD} ${URL}/${PACK}.${arch_ext} + rcmd "Fetching ${PACK}.${arch_ext}" \ + ${WGETCMD} ${URL}/${PACK}.${arch_ext} wget_status=$? # Append log to global log file -- 2.20.1