From c2c501205f4472bdd2cc86bea991b48561e71551 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Wed, 18 Sep 2024 10:49:41 +1000 Subject: [PATCH] Fixup to abort more gracefully when wanted package is missing from the repository. --- build-installer-functions.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-installer-functions.sh b/build-installer-functions.sh index b26f23e..7d50e4d 100644 --- a/build-installer-functions.sh +++ b/build-installer-functions.sh @@ -10,7 +10,7 @@ typeset -A DEBURL DEBDIR PROVIDER PKGS # die() simply prints its arguments as a message to stderr and then # calls exit(1). This is only used at bailout points when something # seems badly wrong. -die() { echo "$*" >&1 ; exit 1 ; } +die() { echo "$*" >&2 ; exit 1 ; } # deb_url_map() reduces a Packages file (argument $1) into a series of # mappings of the form "package=filename". @@ -133,7 +133,7 @@ download() { [ "$QUIET" = yes ] || echo "DOWNLOAD $P" >&2 local URI="${DEBURL["$P"]}" [ "$QUIET" = yes ] || echo "DOWNLOAD URI=$URI" >&2 - [ -z "$URI" ] && die "** Cannot find package $P in the sources!!" + [ -z "$URI" ] && die '** ' "Cannot find package $P in the sources!!" local F="${DEBDIR["$1"]}/${URI##*/}" [ "$QUIET" = yes ] || echo "DOWNLOAD F=$F" >&2 [ -f "$F" ] && continue # alread y downloaded @@ -185,7 +185,8 @@ executable() { # to run (see inline comments) # etc/debconf.conf -- telling where databases are target_dpkg() { - local HERE=$(pwd) + local HERE=$(pwd) X=( ${@##-*} ) + [ -z "$X" ] && die "** Aborting" cd $INITRD if [ ! -f etc/debconf.conf ] ; then cat /etc/debconf.conf | heredoc etc/debconf.conf -- 2.39.2