Verified Commit 43969cc7 authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

adelie-build-cd: More POSIX correctness fixes

parent 56a2be32
#!/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/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment