Fix bug when fetching unavailable package
[hvlinux.git] / functions / fpkg
index 133b123..673299b 100644 (file)
@@ -640,10 +640,15 @@ fpkg()
             rm ${DEST_FILE}
         fi
 
-        if [ !  -f ${DEST_FILE} ]; then
+        if [ ! -f ${DEST_FILE} ]; then
             # Fetch package
             set +e
             static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT}
+            rc=$?
+
+            if [ ${rc} -ne 0 ]; then
+                return ${rc};
+            fi
             set -e
 
             # Move file if source filename is not equal to package name and/or