tree-wide: drop manually-crafted message for missing variables

Bash will generate a very nice message for us:
/tmp/ff.sh: line 1: SOMEVAR: parameter null or not set

Let's save some keystrokes by not replacing this with our own inferior
messages.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-05-04 08:24:06 +02:00 committed by Yu Watanabe
parent 080b8c2ace
commit d7ff524039
7 changed files with 15 additions and 15 deletions

View file

@ -9,7 +9,7 @@ TEST_NO_NSPAWN=1
. "${TEST_BASE_DIR:?}/test-functions"
if qemu_min_version "5.2.0"; then
QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:?QEMU_MEM is unset} -numa node,memdev=mem0,nodeid=0"
QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:?} -numa node,memdev=mem0,nodeid=0"
else
QEMU_OPTIONS="-numa node,nodeid=0"
fi

View file

@ -11,7 +11,7 @@ set -e
export SYSTEMD_LOG_LEVEL=info
ROOTDIR="$(dirname "$(dirname "$(readlink -f "$0")")")"
SYSTEMD_HWDB="${1:?missing argument}"
SYSTEMD_HWDB="${1:?}"
if [ ! -x "$SYSTEMD_HWDB" ]; then
echo "$SYSTEMD_HWDB is not executable" >&2

View file

@ -6,7 +6,7 @@
# rpmspec utility is required (so this test will work with RPM 4 but won't work with RPM 5).
set -eu
BUILD_DIR="${1:?Missing argument: build directory}"
BUILD_DIR="${1:?}"
RPM_MACROS_FILE="${BUILD_DIR:?}/src/rpm/macros.systemd"
if ! command -v rpm >/dev/null || ! command -v rpmspec >/dev/null; then

View file

@ -4,7 +4,7 @@ set -eux
set -o pipefail
_clear_service () {
local SERVICE_NAME="${1:?_clear_service: missing argument}"
local SERVICE_NAME="${1:?}"
systemctl stop "$SERVICE_NAME.service" 2>/dev/null || :
rm -f /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service
rm -fr /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service.d
@ -25,7 +25,7 @@ clear_services () {
}
create_service () {
local SERVICE_NAME="${1:?create_service: missing argument}"
local SERVICE_NAME="${1:?}"
clear_services "$SERVICE_NAME"
cat >/etc/systemd/system/"$SERVICE_NAME".service <<EOF

View file

@ -72,7 +72,7 @@ checkNUMA() {
writePID1NUMAPolicy() {
cat >"$confDir/numa.conf" <<EOF
[Manager]
NUMAPolicy=${1:?missing argument: NUMAPolicy}
NUMAPolicy=${1:?}
NUMAMask=${2:-""}
EOF
}
@ -85,7 +85,7 @@ writeTestUnit() {
writeTestUnitNUMAPolicy() {
cat >"$testUnitNUMAConf" <<EOF
[Service]
NUMAPolicy=${1:?missing argument: NUMAPolicy}
NUMAPolicy=${1:?}
NUMAMask=${2:-""}
EOF
systemctl daemon-reload
@ -106,25 +106,25 @@ pid1ReloadWithJournal() {
pid1StartUnitWithStrace() {
startStrace '-f'
systemctl start "${1:?missing unit name}"
systemctl start "${1:?}"
sleep $sleepAfterStart
stopStrace
}
pid1StartUnitWithJournal() {
startJournalctl
systemctl start "${1:?missing unit name}"
systemctl start "${1:?}"
sleep $sleepAfterStart
stopJournalctl
}
pid1StopUnit() {
systemctl stop "${1:?missing unit name}"
systemctl stop "${1:?}"
}
systemctlCheckNUMAProperties() {
local UNIT_NAME="${1:?missing unit name}"
local NUMA_POLICY="${2:?missing NUMAPolicy}"
local UNIT_NAME="${1:?}"
local NUMA_POLICY="${2:?}"
local NUMA_MASK="${3:-""}"
local LOGFILE

View file

@ -15,7 +15,7 @@ inspect() {
# avoid unexpected fails. To see the full outputs of both homectl &
# userdbctl (for debugging purposes) drop the fields just before the
# comparison.
local USERNAME="${1:?missing argument}"
local USERNAME="${1:?}"
homectl inspect "$USERNAME" | tee /tmp/a
userdbctl user "$USERNAME" | tee /tmp/b

View file

@ -3,8 +3,8 @@
set -eu
set -o pipefail
SOURCE_ROOT="${1:?Missing argument: project source root}"
BUILD_ROOT="${2:?Missing argument: project build root}"
SOURCE_ROOT="${1:?}"
BUILD_ROOT="${2:?}"
command -v gawk &>/dev/null || exit 77