diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-02-02 16:32:40 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-02-02 16:32:40 -0600 |
commit | 43969cc70bf8f631bcfe8a628f903157d962ad9a (patch) | |
tree | 10c7d724f471d4687ac0660e78019088fc3bca16 | |
parent | 56a2be328504b9d7e49ee87279c394644f7a3009 (diff) | |
download | image-43969cc70bf8f631bcfe8a628f903157d962ad9a.tar.gz image-43969cc70bf8f631bcfe8a628f903157d962ad9a.tar.bz2 image-43969cc70bf8f631bcfe8a628f903157d962ad9a.tar.xz image-43969cc70bf8f631bcfe8a628f903157d962ad9a.zip |
adelie-build-cd: More POSIX correctness fixes
-rwxr-xr-x | adelie-build-cd | 13 |
1 files changed, 7 insertions, 6 deletions
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/ |