Use grep -E instead of egrep, use grep -F instead of fgrep.
authorMark Wielaard <mark@klomp.org>
Thu, 27 Oct 2022 16:34:54 +0000 (18:34 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 27 Oct 2022 16:34:54 +0000 (18:34 +0200)
GNU grep 3.8 gives a deprecation warning when using egrep or fgrep.
Just use grep -E and grep -F.

Signed-off-by: Mark Wielaard <mark@klomp.org>
config/ChangeLog
config/eu.am
tests/ChangeLog
tests/backtrace-subr.sh
tests/debuginfod-subr.sh
tests/run-debuginfod-archive-rename.sh
tests/run-debuginfod-extraction-passive.sh
tests/run-debuginfod-response-headers.sh
tests/run-debuginfod-webapi-concurrency.sh
tests/run-strip-test.sh

index 9aadd71..15fee44 100644 (file)
@@ -1,5 +1,9 @@
 2022-10-27  Mark Wielaard  <mark@klomp.org>
 
+       * eu.am: Use grep -F instead of fgrep.
+
+2022-10-27  Mark Wielaard  <mark@klomp.org>
+
        * elfutils.spec.in: Add BuildRequires socat.
 
 2022-08-17  Martin Liska  <mliska@suse.cz>
index 58cd3c4..c3cefe7 100644 (file)
@@ -135,7 +135,7 @@ textrel_found = $(textrel_msg); exit 1
 else
 textrel_found = $(textrel_msg)
 endif
-textrel_check = if $(READELF) -d $@ | fgrep -q TEXTREL; then $(textrel_found); fi
+textrel_check = if $(READELF) -d $@ | grep -F -q TEXTREL; then $(textrel_found); fi
 
 print-%:
        @echo $*=$($*)
index 0ea1df3..be90832 100644 (file)
@@ -1,3 +1,14 @@
+2022-10-27  Mark Wielaard  <mark@klomp.org>
+
+       * backtrace-subr.sh: Use grep -E instead of egrep, use grep -F
+       instead of fgrep.
+       * debuginfod-subr.sh: Likewise.
+       * run-debuginfod-archive-rename.sh: Likewise.
+       * run-debuginfod-extraction-passive.sh: Likewise.
+       * run-debuginfod-response-headers.sh: Likewise.
+       * run-debuginfod-webapi-concurrency.sh: Likewise.
+       * run-strip-test.sh: Likewise.
+
 2022-10-16  Mark Wielaard  <mark@klomp.org>
 
        * dwfl-report-offline-memory.c: Include config.h first.
index 53c719d..b63e381 100644 (file)
@@ -59,7 +59,7 @@ check_backtracegen()
 # Ignore it here as it is a bug of OS, not a bug of elfutils.
 check_err()
 {
-  if [ $(egrep -v <$1 'dwfl_thread_getframes: (No DWARF information found|no matching address range|address out of range|Invalid register|\(null\))$' \
+  if [ $(grep -E -v <$1 'dwfl_thread_getframes: (No DWARF information found|no matching address range|address out of range|Invalid register|\(null\))$' \
          | wc -c) \
        -eq 0 ]
   then
@@ -101,7 +101,7 @@ check_native_unsupported()
   # and we can fall back on .debug_frame for the CFI.
   case "`uname -m`" in
     arm* )
-      if egrep 'dwfl_thread_getframes(.*)No DWARF information found' $err; then
+      if grep -E 'dwfl_thread_getframes(.*)No DWARF information found' $err; then
        echo >&2 $testname: arm needs debuginfo installed for all libraries
        exit 77
       fi
index 0b59b5b..108dff7 100755 (executable)
@@ -141,12 +141,12 @@ archive_test() {
 get_ports() {
   while true; do
     PORT1=`expr '(' $RANDOM % 50 ')' + $base`
-    ss -atn | fgrep ":$PORT1" || break
+    ss -atn | grep -F ":$PORT1" || break
   done
 # Some tests will use two servers, so assign the second var
   while true; do
     PORT2=`expr '(' $RANDOM % 50 ')' + $base + 50`
-    ss -atn | fgrep ":$PORT2" || break
+    ss -atn | grep -F ":$PORT2" || break
   done
 
 }
index a1a6cc1..71f7742 100755 (executable)
@@ -95,7 +95,7 @@ export DEBUGINFOD_URLS=http://127.0.0.1:$PORT1
 archive_test bc1febfd03ca05e030f0d205f7659db29f8a4b30 /usr/src/debug/hello-1.0/hello.c $SHA
 archive_test f0aa15b8aba4f3c28cac3c2a73801fefa644a9f2 /usr/src/debug/hello-1.0/hello.c $SHA
 
-egrep '(libc.error.*rhel7)|(bc1febfd03ca)|(f0aa15b8aba)' vlog$PORT1
+grep -E '(libc.error.*rhel7)|(bc1febfd03ca)|(f0aa15b8aba)' vlog$PORT1
 
 kill $PID1
 wait $PID1
index c2724b5..26618f5 100755 (executable)
@@ -56,10 +56,10 @@ wait_ready $PORT1 'thread_work_pending{role="scan"}' 0
 wait_ready $PORT1 'thread_busy{role="scan"}' 0
 
 # No similar metrics for the passive server
-! (curl http://localhost:$PORT2/metrics | egrep 'role="scan"|role="groom"|role="traverse"')
+! (curl http://localhost:$PORT2/metrics | grep -E 'role="scan"|role="groom"|role="traverse"')
 
 # Confirm no active threads
-! (ps -q $PID2 -e -L -o '%p %c %a' | egrep 'scan|groom|traverse')
+! (ps -q $PID2 -e -L -o '%p %c %a' | grep -E 'scan|groom|traverse')
 
 # Do a random lookup via passive server
 env LD_LIBRARY_PATH=$ldpath DEBUGINFOD_URLS=http://localhost:$PORT2 ${abs_builddir}/../debuginfod/debuginfod-find debuginfo cee13b2ea505a7f37bd20d271c6bc7e5f8d2dfcb
index 63f2f24..8cb7b84 100755 (executable)
@@ -96,7 +96,7 @@ grep -i 'X-DEBUGINFOD-ARCHIVE: ' vlog-find$PORT1.2
 for file in vlog-find$PORT1.1 vlog-find$PORT1.2
 do
     st_size=$(stat -c%s $(tail -n 1 $file))
-    x_debuginfod_size=$(grep -i 'X-DEBUGINFOD-SIZE' $file | head -1 | egrep -o '[0-9]+')
+    x_debuginfod_size=$(grep -i 'X-DEBUGINFOD-SIZE' $file | head -1 | grep -E -o '[0-9]+')
     test $st_size -eq $x_debuginfod_size
 done
 
index 47dcadc..5c2440f 100755 (executable)
@@ -56,7 +56,7 @@ do
     wait_ready $PORT1 'http_responses_transfer_bytes_count{code="200",type="debuginfo"}' $lookup_nr
     
     (sleep 5;
-     curl -s http://localhost:$PORT1/metrics | egrep 'error|responses';
+     curl -s http://localhost:$PORT1/metrics | grep -E 'error|responses';
      kill $PID1) &
     wait # for all curls, the ()& from just above, and for debuginfod
     PID1=0
index 280814e..317c225 100755 (executable)
@@ -66,6 +66,6 @@ test $SIZE_stripped -lt $SIZE_original ||
 
 tempfiles testfile.sections
 testrun ${abs_top_builddir}/src/readelf -S testfile.temp > testfile.sections || status=$?
-fgrep ' .debug_' testfile.sections && status=1
+grep -F ' .debug_' testfile.sections && status=1
 
 exit $status