public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED] Use grep -E instead of egrep, use grep -F instead of fgrep.
@ 2022-10-27 16:37 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2022-10-27 16:37 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

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                           |  4 ++++
 config/eu.am                               |  2 +-
 tests/ChangeLog                            | 11 +++++++++++
 tests/backtrace-subr.sh                    |  4 ++--
 tests/debuginfod-subr.sh                   |  4 ++--
 tests/run-debuginfod-archive-rename.sh     |  2 +-
 tests/run-debuginfod-extraction-passive.sh |  4 ++--
 tests/run-debuginfod-response-headers.sh   |  2 +-
 tests/run-debuginfod-webapi-concurrency.sh |  2 +-
 tests/run-strip-test.sh                    |  2 +-
 10 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/config/ChangeLog b/config/ChangeLog
index 9aadd71f..15fee44f 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/config/eu.am b/config/eu.am
index 58cd3c4f..c3cefe7e 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -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 $*=$($*)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 0ea1df3d..be90832a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -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.
diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index 53c719df..b63e3814 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -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
diff --git a/tests/debuginfod-subr.sh b/tests/debuginfod-subr.sh
index 0b59b5b8..108dff74 100755
--- a/tests/debuginfod-subr.sh
+++ b/tests/debuginfod-subr.sh
@@ -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
 
 }
diff --git a/tests/run-debuginfod-archive-rename.sh b/tests/run-debuginfod-archive-rename.sh
index a1a6cc1e..71f7742a 100755
--- a/tests/run-debuginfod-archive-rename.sh
+++ b/tests/run-debuginfod-archive-rename.sh
@@ -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
diff --git a/tests/run-debuginfod-extraction-passive.sh b/tests/run-debuginfod-extraction-passive.sh
index c2724b58..26618f5c 100755
--- a/tests/run-debuginfod-extraction-passive.sh
+++ b/tests/run-debuginfod-extraction-passive.sh
@@ -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
diff --git a/tests/run-debuginfod-response-headers.sh b/tests/run-debuginfod-response-headers.sh
index 63f2f241..8cb7b843 100755
--- a/tests/run-debuginfod-response-headers.sh
+++ b/tests/run-debuginfod-response-headers.sh
@@ -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
 
diff --git a/tests/run-debuginfod-webapi-concurrency.sh b/tests/run-debuginfod-webapi-concurrency.sh
index 47dcadcc..5c2440ff 100755
--- a/tests/run-debuginfod-webapi-concurrency.sh
+++ b/tests/run-debuginfod-webapi-concurrency.sh
@@ -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
diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh
index 280814e6..317c2256 100755
--- a/tests/run-strip-test.sh
+++ b/tests/run-strip-test.sh
@@ -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
-- 
2.18.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-27 16:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 16:37 [COMMITTED] Use grep -E instead of egrep, use grep -F instead of fgrep Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).