Append wget log to log file even in case of errors
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 28 Nov 2014 05:34:35 +0000 (00:34 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Fri, 5 Dec 2014 04:44:18 +0000 (23:44 -0500)
functions/fpkg

index 7138cad..4d23bda 100644 (file)
@@ -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