# HG changeset patch # User Pascal Bellard # Date 1467733434 -7200 # Node ID 2ed01854de822364826891590ab23700c319bd26 # Parent 8e774023d9355a5f2e6bb2eb4ccef8a3431cf932 get: update abort_package default args diff -r 8e774023d935 -r 2ed01854de82 modules/get --- a/modules/get Tue Jun 28 01:24:30 2016 +0300 +++ b/modules/get Tue Jul 05 17:43:54 2016 +0200 @@ -110,9 +110,9 @@ abort_package() { cd "$CUR_DIR" rm -rf "$tmp_dir" - msg="${1:-Abort $PACKAGE.}" - shift - printf "$msg" $@ + [ -n "$1" ] || + set -- 'Could not download "%s" from "%s". Exiting.' "${TARBALL:-$PACKAGE}" "${WGET_URL:-$WEB_SITE}" + printf "$@" exit 1 } @@ -223,9 +223,7 @@ . "$script" set +e - if [ ! -d "$PACKAGE-$VERSION" ]; then - abort_package 'Could not download "%s" from "%s". Exiting.' "${TARBALL:-$PACKAGE}" "${WGET_URL:-$WEB_SITE}" - fi + [ -d "$PACKAGE-$VERSION" ] || abort_package if [ ! -s "$PACKAGE-$VERSION/receipt" ]; then # Create receipt (if script not created it early) using variables from script