From: Hugo Villeneuve Date: Fri, 28 Nov 2014 05:34:35 +0000 (-0500) Subject: Append wget log to log file even in case of errors X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=9e7347b706ca23d2e293db05d4a201f41ad7f5c4;p=hvlinux.git Append wget log to log file even in case of errors --- diff --git a/functions/fpkg b/functions/fpkg index 7138cad..4d23bda 100644 --- a/functions/fpkg +++ b/functions/fpkg @@ -154,17 +154,24 @@ wget_wrapper() # Arg. #2: Destination filename. static_fetch_patches_list() { + local wget_status + PATCHES_URL=${1} PATCHES_LIST_FILENAME=${2} # Appending a slash (/) will download the directory content as a file named # index.html - ${WGETCMD} "${PATCHES_URL}/" && + ${WGETCMD} "${PATCHES_URL}/" + wget_status=$? # Append log to global log file - cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} && + cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} - mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME} + if [ ${wget_status} -eq 0 ]; then + mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME} + else + return 1 + fi } # Arg. #1: If "test" is specified, set TEST_INTEGRITY to 1