In a thread from just over a month ago, Rob suggested adding 2>/dev/null in calls to egrep to shut up warnings instead of replace it and bow down to the FSF.
http://lists.landley.net/pipermail/toybox-landley.net/2024-February/030030.html "can I just defer this until it's actually _removed_ not deprecated and thus actually breaks builds rather than produces stupid warnings? Is egrep 2>/dev/null a reasonable option in the short term?" The following patch does this and gets rid of warnings when building on arch (btw), and presumably any system with the more recent versions of GNU grep (Mine is 3.11). - Oliver Webb <[email protected]>
From 256601adfecfee3a9d9e42d3375c1da92902eba5 Mon Sep 17 00:00:00 2001 From: Oliver Webb <[email protected]> Date: Sat, 16 Mar 2024 00:24:36 -0500 Subject: [PATCH] Shut up egrep depreciation warning. --- scripts/make.sh | 4 ++-- scripts/single.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/make.sh b/scripts/make.sh index 21b9d7cb..4d1fe967 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -91,7 +91,7 @@ mkdir -p "$UNSTRIPPED" "$(dirname $OUTNAME)" || exit 1 [ -n "$V" ] && echo -e "\nWhich C files to build..." TOYFILES="$($SED -n 's/^CONFIG_\([^=]*\)=.*/\1/p' "$KCONFIG_CONFIG" | xargs | tr ' ' '|')" -TOYFILES="main.c $(egrep -l "^USE_($TOYFILES)[(]...TOY[(]" toys/*/*.c | xargs)" +TOYFILES="main.c $(egrep -l "^USE_($TOYFILES)[(]...TOY[(]" toys/*/*.c 2>/dev/null | xargs)" if [ "${TOYFILES/pending//}" != "$TOYFILES" ] then @@ -133,7 +133,7 @@ fi # Does .config need dependency recalculation because toolchain changed? A="$($SED -n '/^config .*$/h;s/default \(.\)/\1/;T;H;g;s/config \([^\n]*\)[^yn]*\(.\)/\1=\2/p' "$GENDIR"/Config.probed | sort)" -B="$(egrep "^CONFIG_($(echo "$A" | sed 's/=[yn]//' | xargs | tr ' ' '|'))=" "$KCONFIG_CONFIG" | $SED 's/^CONFIG_//' | sort)" +B="$(egrep "^CONFIG_($(echo "$A" | sed 's/=[yn]//' | xargs | tr ' ' '|'))=" "$KCONFIG_CONFIG" 2>/dev/null | $SED 's/^CONFIG_//' | sort)" A="$(echo "$A" | grep -v =n)" [ "$A" != "$B" ] && { echo -e "\nWarning: Config.probed changed, run 'make oldconfig'" >&2; } diff --git a/scripts/single.sh b/scripts/single.sh index e2ed9880..5ab85705 100755 --- a/scripts/single.sh +++ b/scripts/single.sh @@ -25,7 +25,7 @@ KCONFIG_CONFIG=.singleconfig for i in "$@" do echo -n "$i:" - TOYFILE="$(egrep -l "TOY[(]($i)[ ,]" toys/*/*.c)" + TOYFILE="$(egrep -l "TOY[(]($i)[ ,]" toys/*/*.c 2>/dev/null)" if [ -z "$TOYFILE" ] then -- 2.44.0
_______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
