richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
594167
From 910711b21c5fe4f26ad20a4d86e1acfb2a0afbdb Mon Sep 17 00:00:00 2001
594167
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
594167
Date: Wed, 4 May 2022 08:24:06 +0200
594167
Subject: [PATCH] tree-wide: drop manually-crafted message for missing
594167
 variables
594167
594167
Bash will generate a very nice message for us:
594167
/tmp/ff.sh: line 1: SOMEVAR: parameter null or not set
594167
594167
Let's save some keystrokes by not replacing this with our own inferior
594167
messages.
594167
594167
(cherry picked from commit d7ff52403902900b61f644f87b5222822fd4a69b)
594167
594167
Related: #2087652
594167
---
594167
 test/TEST-36-NUMAPOLICY/test.sh |  2 +-
594167
 test/hwdb-test.sh               |  2 +-
594167
 test/test-rpm-macros.sh         |  2 +-
594167
 test/units/testsuite-15.sh      |  4 ++--
594167
 test/units/testsuite-36.sh      | 14 +++++++-------
594167
 test/units/testsuite-46.sh      |  2 +-
594167
 tools/check-directives.sh       |  4 ++--
594167
 7 files changed, 15 insertions(+), 15 deletions(-)
594167
594167
diff --git a/test/TEST-36-NUMAPOLICY/test.sh b/test/TEST-36-NUMAPOLICY/test.sh
594167
index 0eaaee9608..5f38bf1009 100755
594167
--- a/test/TEST-36-NUMAPOLICY/test.sh
594167
+++ b/test/TEST-36-NUMAPOLICY/test.sh
594167
@@ -9,7 +9,7 @@ TEST_NO_NSPAWN=1
594167
 . "${TEST_BASE_DIR:?}/test-functions"
594167
 
594167
 if qemu_min_version "5.2.0"; then
594167
-    QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:?QEMU_MEM is unset} -numa node,memdev=mem0,nodeid=0"
594167
+    QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:?} -numa node,memdev=mem0,nodeid=0"
594167
 else
594167
     QEMU_OPTIONS="-numa node,nodeid=0"
594167
 fi
594167
diff --git a/test/hwdb-test.sh b/test/hwdb-test.sh
594167
index 0551f26a2d..29183e6829 100755
594167
--- a/test/hwdb-test.sh
594167
+++ b/test/hwdb-test.sh
594167
@@ -11,7 +11,7 @@ set -e
594167
 
594167
 export SYSTEMD_LOG_LEVEL=info
594167
 ROOTDIR="$(dirname "$(dirname "$(readlink -f "$0")")")"
594167
-SYSTEMD_HWDB="${1:?missing argument}"
594167
+SYSTEMD_HWDB="${1:?}"
594167
 
594167
 if [ ! -x "$SYSTEMD_HWDB" ]; then
594167
     echo "$SYSTEMD_HWDB is not executable" >&2
594167
diff --git a/test/test-rpm-macros.sh b/test/test-rpm-macros.sh
594167
index 5843b72346..c7107dec3e 100755
594167
--- a/test/test-rpm-macros.sh
594167
+++ b/test/test-rpm-macros.sh
594167
@@ -6,7 +6,7 @@
594167
 # rpmspec utility is required (so this test will work with RPM 4 but won't work with RPM 5).
594167
 set -eu
594167
 
594167
-BUILD_DIR="${1:?Missing argument: build directory}"
594167
+BUILD_DIR="${1:?}"
594167
 RPM_MACROS_FILE="${BUILD_DIR:?}/src/rpm/macros.systemd"
594167
 
594167
 if ! command -v rpm >/dev/null || ! command -v rpmspec >/dev/null; then
594167
diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh
594167
index 0446e71c38..f847adac74 100755
594167
--- a/test/units/testsuite-15.sh
594167
+++ b/test/units/testsuite-15.sh
594167
@@ -4,7 +4,7 @@ set -eux
594167
 set -o pipefail
594167
 
594167
 _clear_service () {
594167
-    local SERVICE_NAME="${1:?_clear_service: missing argument}"
594167
+    local SERVICE_NAME="${1:?}"
594167
     systemctl stop "$SERVICE_NAME.service" 2>/dev/null || :
594167
     rm -f  /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service
594167
     rm -fr /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service.d
594167
@@ -25,7 +25,7 @@ clear_services () {
594167
 }
594167
 
594167
 create_service () {
594167
-    local SERVICE_NAME="${1:?create_service: missing argument}"
594167
+    local SERVICE_NAME="${1:?}"
594167
     clear_services "$SERVICE_NAME"
594167
 
594167
     cat >/etc/systemd/system/"$SERVICE_NAME".service <
594167
diff --git a/test/units/testsuite-36.sh b/test/units/testsuite-36.sh
594167
index b6c00c4845..cc4deffdbd 100755
594167
--- a/test/units/testsuite-36.sh
594167
+++ b/test/units/testsuite-36.sh
594167
@@ -72,7 +72,7 @@ checkNUMA() {
594167
 writePID1NUMAPolicy() {
594167
     cat >"$confDir/numa.conf" <
594167
 [Manager]
594167
-NUMAPolicy=${1:?missing argument: NUMAPolicy}
594167
+NUMAPolicy=${1:?}
594167
 NUMAMask=${2:-""}
594167
 EOF
594167
 }
594167
@@ -85,7 +85,7 @@ writeTestUnit() {
594167
 writeTestUnitNUMAPolicy() {
594167
     cat >"$testUnitNUMAConf" <
594167
 [Service]
594167
-NUMAPolicy=${1:?missing argument: NUMAPolicy}
594167
+NUMAPolicy=${1:?}
594167
 NUMAMask=${2:-""}
594167
 EOF
594167
     systemctl daemon-reload
594167
@@ -106,25 +106,25 @@ pid1ReloadWithJournal() {
594167
 
594167
 pid1StartUnitWithStrace() {
594167
     startStrace '-f'
594167
-    systemctl start "${1:?missing unit name}"
594167
+    systemctl start "${1:?}"
594167
     sleep $sleepAfterStart
594167
     stopStrace
594167
 }
594167
 
594167
 pid1StartUnitWithJournal() {
594167
     startJournalctl
594167
-    systemctl start "${1:?missing unit name}"
594167
+    systemctl start "${1:?}"
594167
     sleep $sleepAfterStart
594167
     stopJournalctl
594167
 }
594167
 
594167
 pid1StopUnit() {
594167
-    systemctl stop "${1:?missing unit name}"
594167
+    systemctl stop "${1:?}"
594167
 }
594167
 
594167
 systemctlCheckNUMAProperties() {
594167
-    local UNIT_NAME="${1:?missing unit name}"
594167
-    local NUMA_POLICY="${2:?missing NUMAPolicy}"
594167
+    local UNIT_NAME="${1:?}"
594167
+    local NUMA_POLICY="${2:?}"
594167
     local NUMA_MASK="${3:-""}"
594167
     local LOGFILE
594167
 
594167
diff --git a/test/units/testsuite-46.sh b/test/units/testsuite-46.sh
594167
index c3e57cec95..61ee921151 100755
594167
--- a/test/units/testsuite-46.sh
594167
+++ b/test/units/testsuite-46.sh
594167
@@ -15,7 +15,7 @@ inspect() {
594167
     # avoid unexpected fails. To see the full outputs of both homectl &
594167
     # userdbctl (for debugging purposes) drop the fields just before the
594167
     # comparison.
594167
-    local USERNAME="${1:?missing argument}"
594167
+    local USERNAME="${1:?}"
594167
     homectl inspect "$USERNAME" | tee /tmp/a
594167
     userdbctl user "$USERNAME" | tee /tmp/b
594167
 
594167
diff --git a/tools/check-directives.sh b/tools/check-directives.sh
594167
index 0661da4d3b..af846c4d73 100755
594167
--- a/tools/check-directives.sh
594167
+++ b/tools/check-directives.sh
594167
@@ -3,8 +3,8 @@
594167
 set -eu
594167
 set -o pipefail
594167
 
594167
-SOURCE_ROOT="${1:?Missing argument: project source root}"
594167
-BUILD_ROOT="${2:?Missing argument: project build root}"
594167
+SOURCE_ROOT="${1:?}"
594167
+BUILD_ROOT="${2:?}"
594167
 
594167
 command -v gawk &>/dev/null || exit 77
594167