From 360e057dcc7b4275db1f5ad6ce66c4aa02a3d2d4 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 21 May 2021 16:28:49 +0200 Subject: [PATCH] Bail out if architecture isn't set nor can be identified automatically If `dpkg --print-architecture` isn't available for detecting the current architecture (e.g. on non-Debian), and neither $ARCH is set nor `--arch ...` was specified, abort and inform user about it. Closes: grml/grml-debootstrap#173 --- grml-debootstrap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grml-debootstrap b/grml-debootstrap index d62cd2c..c31b5cd 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1155,6 +1155,12 @@ else ARCHCMD="--arch $ARCH" ARCHINFO=" (${ARCH})" fi + +if [ -z "${ARCH:-}" ] ; then + eerror 'Architecture neither set (environment variable ARCH), nor could be automatically identified (using dpkg).' + eerror 'Consider setting the --arch ... option.' ; eend 1 + bailout 1 +fi # }}} # It is not possible to build amd64 on i686. {{{ -- 2.1.4