From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 05 May 2023 22:16:17 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pv1qk-006ZWG-9g for lore@lore.pengutronix.de; Fri, 05 May 2023 22:16:17 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pv1qi-0007Av-Dw; Fri, 05 May 2023 22:16:16 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pv1qJ-0007AV-8e for ptxdist@pengutronix.de; Fri, 05 May 2023 22:15:51 +0200 From: Lucas Stach To: ptxdist@pengutronix.de Date: Fri, 5 May 2023 22:15:51 +0200 Message-Id: <20230505201551.903822-1-l.stach@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] replace egrep with grep -E X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Starting with grep 3.8, using egrep emits a warning: egrep: warning: egrep is obsolescent; using grep -E Replace all usages of egrep, which has been deprecated since release 2.5.3 (2007), with grep -E. Signed-off-by: Lucas Stach --- bin/ptxdist | 6 +++--- configure.ac | 3 --- scripts/lib/ptxd_make_image_fix_permissions.sh | 2 +- scripts/ptx-file_check | 8 ++++---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/bin/ptxdist b/bin/ptxdist index 724c2b0d9e60..8ede9b211051 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -1410,7 +1410,7 @@ do_select() fi # check if magic is present in config file - if ! egrep -q "^${magic}$" "${file}" && [ -z "${PTXDIST_FORCE}" ]; then + if ! grep -E -q "^${magic}$" "${file}" && [ -z "${PTXDIST_FORCE}" ]; then ptxd_dialog_msgbox \ "error: Couldn't verify that\n" \ " '${file}'\n" \ @@ -2211,7 +2211,7 @@ setup_env() { unset $({ export -p | sed -n 's/^declare -x \([^=]*\).*$/\1/p' export -fp | sed -n 's/^declare -fx \([^=]*\).*$/\1/p' - } | egrep -v "^(PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|CCACHE_.*|PWD|HOME|USER|PATH|TERM|COLUMNS|LINES|DISPLAY|TMPDIR|KCONFIG_ALLCONFIG|KCONFIG_SEED|http_proxy|https_proxy|ftp_proxy|no_proxy${whitelist})$") + } | grep -E -v "^(PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|CCACHE_.*|PWD|HOME|USER|PATH|TERM|COLUMNS|LINES|DISPLAY|TMPDIR|KCONFIG_ALLCONFIG|KCONFIG_SEED|http_proxy|https_proxy|ftp_proxy|no_proxy${whitelist})$") ######## the environment is clean now ######## @@ -2361,7 +2361,7 @@ setup_parallel() { # this one is for Linux if [ -r /proc/cpuinfo ]; then - cpus="$(egrep '^(processor|cpu )' /proc/cpuinfo | wc -l)" + cpus="$(grep -E '^(processor|cpu )' /proc/cpuinfo | wc -l)" if [ ${cpus} -eq 0 ]; then cpus=1 fi diff --git a/configure.ac b/configure.ac index efd4bac52a88..43e00f86ed37 100644 --- a/configure.ac +++ b/configure.ac @@ -172,9 +172,6 @@ GNU_TOOL(tar, tar) GNU_TOOL(find, findutils) GNU_TOOL(xargs, findutils) -dnl Check for egrep -AC_PROG_EGREP - dnl Check for awk AC_PROG_AWK AC_PATH_PROGS(AWK, ${AWK},) diff --git a/scripts/lib/ptxd_make_image_fix_permissions.sh b/scripts/lib/ptxd_make_image_fix_permissions.sh index bf1a2c816b0f..f53f45baee1d 100644 --- a/scripts/lib/ptxd_make_image_fix_permissions.sh +++ b/scripts/lib/ptxd_make_image_fix_permissions.sh @@ -35,7 +35,7 @@ ptxd_make_image_fix_permissions_check() { ptxd_check_obsolete_perm "${ptxd_reply_perm_files[@]}" # just care about dev-nodes, for now - egrep -h "^[n]${IFS}" "${ptxd_reply_perm_files[@]}" | + grep -E -h "^[n]${IFS}" "${ptxd_reply_perm_files[@]}" | while read kind file uid_should gid_should prm_should type major_should minor_should; do local fixup=false file="${workdir}/${file#/}" diff --git a/scripts/ptx-file_check b/scripts/ptx-file_check index 51bf9ed634ac..3b564aca06ec 100755 --- a/scripts/ptx-file_check +++ b/scripts/ptx-file_check @@ -134,7 +134,7 @@ create_md5(){ debug_out "ROOT Directory is >$(pwd)<" RELEASEDIR=$STORE/$RELEASE mkdir -p "$RELEASEDIR" || my_exit "mkdir $ROOT/$RELEASEDIR failed" 1 - find . -type f | egrep -v "/sys/|/proc/|/dev/|/mnt|/$STORE" > $RELEASEDIR/files.list + find . -type f | grep -E -v "/sys/|/proc/|/dev/|/mnt|/$STORE" > $RELEASEDIR/files.list LC_ALL=C sort -u $RELEASEDIR/files.list > $RELEASEDIR/files.list.tmp && mv $RELEASEDIR/files.list.tmp $RELEASEDIR/files.list while read line ; do md5sum $line @@ -159,14 +159,14 @@ check_md5(){ md5sum -c $RELEASEDIR/files.md5 | grep -v OK | sed s/:\ FAILED//g>> $LOCALSTATSDIR/check-md5.status echo "------------ END -------------" >> $LOCALSTATSDIR/check-md5.status # - find . -type f | egrep -v "/sys/|/proc/|/dev/|/mnt|/$STORE" > $LOCALSTATSDIR/files.list + find . -type f | grep -E -v "/sys/|/proc/|/dev/|/mnt|/$STORE" > $LOCALSTATSDIR/files.list LC_ALL=C sort -u $LOCALSTATSDIR/files.list > $LOCALSTATSDIR/files.list.tmp && mv $LOCALSTATSDIR/files.list.tmp $LOCALSTATSDIR/files.list echo "# $(date)" > $LOCALSTATSDIR/check-files.status echo "# These files do not appear in release $RELEASE, " >> $LOCALSTATSDIR/check-files.status echo "# however - they appear on the system:" >> $LOCALSTATSDIR/check-files.status echo "# " >> $LOCALSTATSDIR/check-files.status echo "----------- START ------------" >> $LOCALSTATSDIR/check-files.status - diff $RELEASEDIR/files.list $LOCALSTATSDIR/files.list | egrep "<|>" | sed s/'[><][ ][\.]'//g >> $LOCALSTATSDIR/check-files.status + diff $RELEASEDIR/files.list $LOCALSTATSDIR/files.list | grep -E "<|>" | sed s/'[><][ ][\.]'//g >> $LOCALSTATSDIR/check-files.status echo "------------ END -------------" >> $LOCALSTATSDIR/check-files.status # if [ "$REPORT" = "true" ]; then @@ -211,7 +211,7 @@ check_ipkglist(){ echo "# These package versions differ from release $RELEASE:" >> $LOCALSTATSDIR/check-ipkglist.status echo "# " >> $LOCALSTATSDIR/check-ipkglist.status echo "----------- START ------------" >> $LOCALSTATSDIR/check-ipkglist.status - diff $RELEASEDIR/ipkg.list $LOCALSTATSDIR/ipkg.list | egrep ">" | sed s/'[><][ ]'//g >> $LOCALSTATSDIR/check-ipkglist.status + diff $RELEASEDIR/ipkg.list $LOCALSTATSDIR/ipkg.list | grep -E ">" | sed s/'[><][ ]'//g >> $LOCALSTATSDIR/check-ipkglist.status echo "------------ END -------------" >> $LOCALSTATSDIR/check-ipkglist.status # if [ "$REPORT" = "true" ]; then -- 2.39.2