tazpkg diff modules/get @ rev 911

get: update abort_package default args
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 05 17:43:54 2016 +0200 (2016-07-05)
parents 8e774023d935
children d36dc9257f15
line diff
     1.1 --- a/modules/get	Tue Jun 28 01:24:30 2016 +0300
     1.2 +++ b/modules/get	Tue Jul 05 17:43:54 2016 +0200
     1.3 @@ -110,9 +110,9 @@
     1.4  abort_package() {
     1.5  	cd "$CUR_DIR"
     1.6  	rm -rf "$tmp_dir"
     1.7 -	msg="${1:-Abort $PACKAGE.}"
     1.8 -	shift
     1.9 -	printf "$msg" $@
    1.10 +	[ -n "$1" ] ||
    1.11 +	set -- 'Could not download "%s" from "%s". Exiting.' "${TARBALL:-$PACKAGE}" "${WGET_URL:-$WEB_SITE}"
    1.12 +	printf "$@"
    1.13  	exit 1
    1.14  }
    1.15  
    1.16 @@ -223,9 +223,7 @@
    1.17  	. "$script"
    1.18  	set +e
    1.19  
    1.20 -	if [ ! -d "$PACKAGE-$VERSION" ]; then
    1.21 -		abort_package 'Could not download "%s" from "%s". Exiting.' "${TARBALL:-$PACKAGE}" "${WGET_URL:-$WEB_SITE}"
    1.22 -	fi
    1.23 +	[ -d "$PACKAGE-$VERSION" ] || abort_package
    1.24  
    1.25  	if [ ! -s "$PACKAGE-$VERSION/receipt" ]; then
    1.26  		# Create receipt (if script not created it early) using variables from script