diff --git a/common/libs/func_download_pkgs b/common/libs/func_download_pkgs index f2b23c7..537f6c0 100644 --- a/common/libs/func_download_pkgs +++ b/common/libs/func_download_pkgs @@ -3,6 +3,10 @@ #----------------------------# get_sources() { # Download file, write name to MISSING_FILES.DMP if an error #----------------------------# + + # Test if the packages must be downloaded + [ ! "$GETPKG" = "y" ] && return + local saveIFS=$IFS local IFS line URL1 URL2 FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE WGETPARAM @@ -13,9 +17,6 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if WGETPARAM+=" --tries ${RETRYDOWNLOADCNT}" WGETPARAM+=" --timeout ${DOWNLOADTIMEOUT}" - # Test if the packages must be downloaded - [ ! "$GETPKG" = "y" ] && return - gs_wrt_message(){ echo "${RED}$1${OFF}" echo "$1" >> MISSING_FILES.DMP @@ -27,6 +28,9 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if # Generate URLs file create_urls + # Clean up leftovers from preceding attempts + >MISSING_FILES.DMP + IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only for line in `cat urls.lst`; do IFS=$saveIFS # Restore the system defaults @@ -110,6 +114,7 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if if [ ! -z ${SRC_ARCHIVE} ] && [ -d ${SRC_ARCHIVE} ] && [ -w ${SRC_ARCHIVE} ] && + [ ! -f ${SRC_ARCHIVE}/$FILE ] && [ "$fromARCHIVE" = "0" ] ; then echo "Storing file:<$FILE> in the package archive" cp -f $FILE ${SRC_ARCHIVE}