From 9e7347b706ca23d2e293db05d4a201f41ad7f5c4 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 28 Nov 2014 00:34:35 -0500 Subject: [PATCH] Append wget log to log file even in case of errors --- functions/fpkg | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 -- 2.20.1