From 60bd909801c3284bcdad7b04edee209813cc7d4e Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 2 Feb 2020 14:49:51 -0600 Subject: adelie-build-cd: Final pass of bashism removal --- adelie-build-cd | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'adelie-build-cd') diff --git a/adelie-build-cd b/adelie-build-cd index 36967d6..5c48f3d 100755 --- a/adelie-build-cd +++ b/adelie-build-cd @@ -32,32 +32,32 @@ fatal() { ensure_commands() { - if ! type apk>/dev/null 2>/dev/null; then + if ! command -pv apk>/dev/null 2>/dev/null; then fatal printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n' - exit -1 + exit 127 fi - if ! type cpio>/dev/null 2>/dev/null; then + if ! command -pv cpio>/dev/null 2>/dev/null; then fatal printf 'You must have cpio installed. On Gentoo, see app-arch/cpio.\n' - exit -1 + exit 127 fi - if ! type mksquashfs>/dev/null 2>/dev/null; then + if ! command -pv mksquashfs>/dev/null 2>/dev/null; then fatal printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n' - exit -1 + exit 127 fi - if ! type xorriso>/dev/null 2>/dev/null; then + if ! command -pv xorriso>/dev/null 2>/dev/null; then fatal printf 'You must have xorriso installed:\n\n' printf '* cdrkit (Alpine, Gentoo) will not generate a usable PPC ISO.\n' printf '* wodim (Debian) will not generate a usable PPC64 ISO.\n' printf '* cdrtools (Schily) will overrun the PPC64 ISO and write junk to grubcore.img.\n' printf '\nSorry, but xorriso really is required.\n' - exit -1 + exit 127 fi } @@ -101,7 +101,7 @@ while [ -n "$1" ]; do ;; *) usage >&2 - exit -1 + exit 127 ;; esac shift @@ -131,7 +131,7 @@ clean_dirs() { printf 'This will erase all files at the directories %s/cdroot-%s\n' `pwd` $ARCH printf '%s/initrd-%s and %s/squashroot-%s.\n\n' `pwd` $ARCH `pwd` $ARCH printf 'When you are ready, press RETURN. To cancel, press Ctrl-C.\n' - read + read dontcare rm -rf cdroot-$ARCH rm -rf initrd-$ARCH @@ -300,9 +300,7 @@ make_initrd() { header 'Compressing initrd...' - pushd initrd-$ARCH - find . | cpio -H newc -o > ../cdroot-$ARCH/initrd - popd + (cd initrd-$ARCH; find . | cpio -H newc -o) > cdroot-$ARCH/initrd gzip -9 cdroot-$ARCH/initrd mv cdroot-$ARCH/initrd.gz cdroot-$ARCH/initrd } -- cgit v1.2.3-70-g09d2