From 5c43cfb05c9885d743723b1e0a3a7d2b1594dafd Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sun, 1 Jan 2023 19:22:10 +0100 Subject: [PATCH 1/3] 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. --- cfg.mk | 2 +- doc/find.texi | 2 +- init.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cfg.mk b/cfg.mk index 97086496..75cf1fc3 100644 --- a/cfg.mk +++ b/cfg.mk @@ -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 diff --git a/init.cfg b/init.cfg index 98423613..42daffb4 100644 --- a/init.cfg +++ b/init.cfg @@ -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. -- 2.39.0