From patchwork Thu Oct 27 16:37:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 59554 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 91F26384B04E for ; Thu, 27 Oct 2022 16:37:35 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id BD6B3385153C for ; Thu, 27 Oct 2022 16:37:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD6B3385153C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id C60C130007DA; Thu, 27 Oct 2022 18:37:13 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 848C5413CD0E; Thu, 27 Oct 2022 18:37:13 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Subject: [COMMITTED] Use grep -E instead of egrep, use grep -F instead of fgrep. Date: Thu, 27 Oct 2022 18:37:12 +0200 Message-Id: <20221027163712.31699-1-mark@klomp.org> X-Mailer: git-send-email 2.18.4 X-Spam-Status: No, score=-3038.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_BADIPHTTP, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Cc: Mark Wielaard Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" 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 --- 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 + + * 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 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 + + * 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 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