From 43969cc70bf8f631bcfe8a628f903157d962ad9a Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 2 Feb 2020 16:32:40 -0600 Subject: adelie-build-cd: More POSIX correctness fixes --- adelie-build-cd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'adelie-build-cd') diff --git a/adelie-build-cd b/adelie-build-cd index 29c1e14..6c3840f 100755 --- a/adelie-build-cd +++ b/adelie-build-cd @@ -1,5 +1,6 @@ #!/bin/sh -e +set -e def_arch=$(uname -m) def_ver="1.0-rc1" readonly PROGNAME=$(basename $0) @@ -32,7 +33,7 @@ fatal() { ensure_commands() { - if ! command -pv apk>/dev/null 2>/dev/null; then + if ! command -v apk>/dev/null 2>/dev/null; then fatal printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n' exit 127 @@ -44,13 +45,13 @@ ensure_commands() { exit 127 fi - if ! command -pv mksquashfs>/dev/null 2>/dev/null; then + if ! command -v mksquashfs>/dev/null 2>/dev/null; then fatal printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n' exit 127 fi - if ! command -pv xorriso>/dev/null 2>/dev/null; then + if ! command -v 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' @@ -144,9 +145,9 @@ clean_dirs() { install_pkgs() { header "Installing base system to squash root..." - readonly PACKAGES=$(cat packages/base 2>/dev/null || fatal 'No core packages specified') - readonly ARCH_PKGS=$(cat packages/arch/$ARCH 2>/dev/null || echo '') - readonly KIND_PKGS=$(cat packages/kind/$KIND 2>/dev/null || echo '') + readonly PACKAGES="$(cat packages/base 2>/dev/null | tr '\n' ' ' || fatal 'No core packages specified')" + readonly ARCH_PKGS="$(cat packages/arch/$ARCH 2>/dev/null | tr '\n' ' ' || echo '')" + readonly KIND_PKGS="$(cat packages/kind/$KIND 2>/dev/null | tr '\n' ' ' || echo '')" mkdir -p squashroot-$ARCH/etc/apk/keys cp 'packages@adelielinux.org.pub' squashroot-$ARCH/etc/apk/keys/ -- cgit v1.2.3-70-g09d2