spk rev 160

libspk.sh: exit downlaod if sum dont match
author Christophe Lincoln <pankso@slitaz.org>
date Thu Feb 16 19:22:27 2017 +0100 (2017-02-16)
parents bda034569b7f
children a0bdc170c51e
files lib/libspk.sh
line diff
     1.1 --- a/lib/libspk.sh	Sun Mar 22 15:21:21 2015 +0100
     1.2 +++ b/lib/libspk.sh	Thu Feb 16 19:22:27 2017 +0100
     1.3 @@ -149,7 +149,9 @@
     1.4  	debug "mirror $SUM : $msum"
     1.5  	debug "local $SUM  : $sum"
     1.6  	if [ "$sum" != "$msum" ]; then
     1.7 -		rm -f $file && download "$file" $mirror
     1.8 +		gettext "ERROR: Checking:"; colorize 31 " ${CHECKSUM} $(basename $file)"
     1.9 +		rm -f $file #&& download "$file" $mirror
    1.10 +		newline && exit 1
    1.11  	fi
    1.12  }
    1.13  
    1.14 @@ -201,7 +203,7 @@
    1.15  	# Be sure the file was fetched.
    1.16  	if [ ! -f "$CACHE_DIR/$file" ] && [ ! -f "$pwd/$file" ]; then
    1.17  		gettext "ERROR: Missing file:"; colorize 31 " $CACHE_DIR/$file"
    1.18 -		newline && exit 1
    1.19 +		newline && return 1
    1.20  	fi
    1.21  }
    1.22