From: Mark Wielaard Date: Thu, 27 Oct 2022 16:34:54 +0000 (+0200) Subject: Use grep -E instead of egrep, use grep -F instead of fgrep. X-Git-Tag: elfutils-0.188~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73d016bde224af6d1be7c86fb2ea67af22f7582f;p=thirdparty%2Felfutils.git Use grep -E instead of egrep, use grep -F instead of fgrep. 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 --- diff --git a/config/ChangeLog b/config/ChangeLog index 9aadd71fd..15fee44f0 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2022-10-27 Mark Wielaard + + * eu.am: Use grep -F instead of fgrep. + 2022-10-27 Mark Wielaard * elfutils.spec.in: Add BuildRequires socat. diff --git a/config/eu.am b/config/eu.am index 58cd3c4fe..c3cefe7e1 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 0ea1df3d1..be90832a7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,14 @@ +2022-10-27 Mark Wielaard + + * 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 * dwfl-report-offline-memory.c: Include config.h first. diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh index 53c719dfe..b63e38144 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 0b59b5b87..108dff744 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 a1a6cc1e5..71f7742a4 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 c2724b58d..26618f5c0 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 63f2f241d..8cb7b843d 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 47dcadcce..5c2440ff8 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 280814e6d..317c2256e 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