From: Josef Schlehofer Date: Wed, 29 Jul 2026 05:47:42 +0000 (+0200) Subject: tree-wide: remove quiet mode from grep in test version checks X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=308a5db9654b4cf9f8a97976e5a1657649ad683e;p=openwrt-packages.git tree-wide: remove quiet mode from grep in test version checks Remove the quiet mode flag (-q) from grep in version check commands to ensure that their stdout output is visible. While at it, switch the remaining regex matches (perl, sscep, awscli) to fixed-string matching where appropriate, so that special characters in the version string are matched literally. For libzip, the zipcmp and zipmerge branches ran grep and then unconditionally exited 0, so a version mismatch was never reported and the version check override always passed. Signed-off-by: Josef Schlehofer --- diff --git a/admin/rsyslog/test.sh b/admin/rsyslog/test.sh index 7dd5f6604..6bb1baed0 100644 --- a/admin/rsyslog/test.sh +++ b/admin/rsyslog/test.sh @@ -2,7 +2,7 @@ case "$1" in rsyslog) - rsyslogd -v 2>&1 | grep -qF "$2" || { + rsyslogd -v 2>&1 | grep -F "$2" || { echo "FAIL: rsyslogd -v did not print expected version '$2'" exit 1 } diff --git a/devel/delve/test.sh b/devel/delve/test.sh index 67ab39212..52ce50a76 100644 --- a/devel/delve/test.sh +++ b/devel/delve/test.sh @@ -2,7 +2,7 @@ case "$1" in delve) - dlv version 2>&1 | grep -qF "$2" || { + dlv version 2>&1 | grep -F "$2" || { echo "FAIL: dlv version did not print expected version '$2'" exit 1 } diff --git a/devel/lttng-tools/test.sh b/devel/lttng-tools/test.sh index 36481c0ba..c3a9f1f01 100644 --- a/devel/lttng-tools/test.sh +++ b/devel/lttng-tools/test.sh @@ -2,7 +2,7 @@ case "$1" in lttng-tools) - lttng --version 2>&1 | grep -qF "$2" || { + lttng --version 2>&1 | grep -F "$2" || { echo "FAIL: lttng --version did not print expected version '$2'" exit 1 } diff --git a/lang/perl/test-version.sh b/lang/perl/test-version.sh index 2920cae61..e19bf8513 100755 --- a/lang/perl/test-version.sh +++ b/lang/perl/test-version.sh @@ -1,7 +1,7 @@ #!/bin/sh case "$PKG_NAME" in perl) - perl -v 2>&1 | grep -q "v$PKG_VERSION" + perl -v 2>&1 | grep -F "v$PKG_VERSION" ;; perlbase-archive|perlbase-pod|perlbase-test) # Perl script wrappers do not output the OpenWrt package version string diff --git a/lang/python/python-awscli/test.sh b/lang/python/python-awscli/test.sh index cf015ee6b..e24f988c6 100755 --- a/lang/python/python-awscli/test.sh +++ b/lang/python/python-awscli/test.sh @@ -11,7 +11,7 @@ assert driver is not None EOF # Verify the aws binary runs --version -aws --version 2>&1 | grep -q "aws-cli" || { +aws --version 2>&1 | grep -F "aws-cli" || { echo "ERROR: 'aws --version' did not produce expected output" exit 1 } diff --git a/libs/libzip/test-version.sh b/libs/libzip/test-version.sh index f7b063b3f..7e35000ca 100755 --- a/libs/libzip/test-version.sh +++ b/libs/libzip/test-version.sh @@ -9,12 +9,12 @@ libzip-*) ;; zipcmp) - zipcmp -V 2>&1 | grep -qF "libzip $PKG_VERSION" + zipcmp -V 2>&1 | grep -F "libzip $PKG_VERSION" || exit 1 exit 0 ;; zipmerge) - zipmerge -V 2>&1 | grep -qF "libzip $PKG_VERSION" + zipmerge -V 2>&1 | grep -F "libzip $PKG_VERSION" || exit 1 exit 0 ;; diff --git a/libs/lmdb/test-version.sh b/libs/lmdb/test-version.sh index 5ec4e2b60..54c516099 100755 --- a/libs/lmdb/test-version.sh +++ b/libs/lmdb/test-version.sh @@ -11,7 +11,7 @@ lmdb-test) exit 0 ;; lmdb-utils) - mdb_dump -V 2>&1 | grep -qF "LMDB $ver" || exit 1 + mdb_dump -V 2>&1 | grep -F "LMDB $ver" || exit 1 exit 0 ;; *) diff --git a/net/fail2ban/test.sh b/net/fail2ban/test.sh index 3d9df8d16..facb36c89 100755 --- a/net/fail2ban/test.sh +++ b/net/fail2ban/test.sh @@ -3,7 +3,7 @@ [ "$1" = fail2ban ] || exit 0 # Verify fail2ban-client binary is present and functional -fail2ban-client --version 2>&1 | grep -qi "fail2ban" || \ +fail2ban-client --version 2>&1 | grep -i "fail2ban" || \ { echo "fail2ban-client --version did not produce expected output"; exit 1; } python3 - << 'EOF' diff --git a/net/sscep/test.sh b/net/sscep/test.sh index da49bf550..c9764e33b 100644 --- a/net/sscep/test.sh +++ b/net/sscep/test.sh @@ -1,3 +1,3 @@ #!/bin/sh -sscep | grep -q "$PKG_VERSION" +sscep | grep -F "$PKG_VERSION" diff --git a/sound/upmpdcli/test.sh b/sound/upmpdcli/test.sh index 34dbfe406..5a4983523 100644 --- a/sound/upmpdcli/test.sh +++ b/sound/upmpdcli/test.sh @@ -5,11 +5,11 @@ upmpdcli) # Version check: upmpdcli prints version to stderr on bad args, or to # stdout with --version; try both. ver_out=$(upmpdcli --version 2>&1 || upmpdcli -v 2>&1 || true) - echo "$ver_out" | grep -qF "$2" || { + echo "$ver_out" | grep -F "$2" || { # Some builds print only the short semver, not the full string; # check for the major.minor part at minimum. major_minor=$(echo "$2" | cut -d. -f1-2) - echo "$ver_out" | grep -qF "$major_minor" || { + echo "$ver_out" | grep -F "$major_minor" || { echo "FAIL: version '$2' not found in: $ver_out" exit 1 } diff --git a/utils/coreutils/test-version.sh b/utils/coreutils/test-version.sh index 0b211d999..b07486835 100755 --- a/utils/coreutils/test-version.sh +++ b/utils/coreutils/test-version.sh @@ -11,6 +11,6 @@ echo|false|kill|printf|pwd|test|true) exit 0 ;; *) - "$EXEC" --version 2>&1 | grep -qF "$PKG_VERSION" + "$EXEC" --version 2>&1 | grep -F "$PKG_VERSION" ;; esac