From: Michael Prokop Date: Fri, 21 May 2021 14:28:49 +0000 (+0200) Subject: Bail out if architecture isn't set nor can be identified automatically X-Git-Tag: v0.97~3 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=360e057dcc7b4275db1f5ad6ce66c4aa02a3d2d4 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 --- 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. {{{