diff options
author | Bernhard Voelker <mail@bernhard-voelker.de> | 2023-01-01 19:22:10 +0100 |
---|---|---|
committer | Bernhard Voelker <mail@bernhard-voelker.de> | 2023-01-01 23:15:36 +0100 |
commit | 5c43cfb05c9885d743723b1e0a3a7d2b1594dafd (patch) | |
tree | 4ef53049ff9a44eb9c15e545d7a4371045be09bc | |
parent | 4391e438a4c947f2f4d89ac65c19722a3dd94195 (diff) | |
download | findutils-5c43cfb05c9885d743723b1e0a3a7d2b1594dafd.tar.gz |
maint: avoid unportable 'grep -q'
The upcoming gnulib update comes with the new syntax-check named
'sc_unportable_grep_q':
maint.mk: unportable 'grep -q', use >/dev/null instead
make: *** [maint.mk:1377: sc_unportable_grep_q] Error 1
Fix offending places.
* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Replace unportable '-q' by redirecting grep output to /dev/null.
* doc/find.texi (node Adding Tests): Likewise.
* init.cfg (find_emits_warnings_): Likewise.
-rw-r--r-- | cfg.mk | 2 | ||||
-rw-r--r-- | doc/find.texi | 2 | ||||
-rw-r--r-- | init.cfg | 2 |
3 files changed, 3 insertions, 3 deletions
@@ -232,7 +232,7 @@ sc_prohibit_test_calls_print_ver_with_irrelevant_argument: | { fail=0; \ while read file name; do \ for i in $$name; do \ - grep -w "$$i" $$file|grep -vw print_ver_|grep -q . \ + grep -w "$$i" $$file|grep -vw print_ver_|grep . >/dev/null \ || { fail=1; \ echo "*** Test: $$file, offending: $$i." 1>&2; };\ done; \ diff --git a/doc/find.texi b/doc/find.texi index 379fe646..bf70be6c 100644 --- a/doc/find.texi +++ b/doc/find.texi @@ -3050,7 +3050,7 @@ its argument is an unstripped binary file: @example #! /bin/sh -file "$1" | grep -q "not stripped" +file "$1" | grep "not stripped" >/dev/null @end example @@ -520,7 +520,7 @@ find_emits_warnings_() { # Find usually emits a warning for the deprecated -d option. find -maxdepth 0 -d -quit 2>&1 \ - | grep -q 'warning:' + | grep 'warning:' >/dev/null } # Skip the current test if "." lacks d_type support. |