[tools] all: replace deprecated egrep with grep -E

8 views
Skip to first unread message

Hyang-Ah Hana Kim (Gerrit)

unread,
Sep 23, 2022, 9:31:14 AM9/23/22
to shuang cui, Gerrit Bot, Hyang-Ah Hana Kim, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Bryan Mills, Robert Findley, Gopher Robot, golang-co...@googlegroups.com

Hyang-Ah Hana Kim submitted this change.

View Change



1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: Robert Findley: Looks good to me, approved Bryan Mills: Looks good to me, but someone else must approve
all: replace deprecated egrep with grep -E

egrep command is about to be deprecated, use grep -E instead.

Reference: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html

Change-Id: Ib37f5b244ead4c2d46078bea34d4cb6363c48b1b
GitHub-Last-Rev: b1e16d0212d682c780668e62ac8659973bb11a9d
GitHub-Pull-Request: golang/tools#400
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432295
Reviewed-by: Bryan Mills <bcm...@google.com>
Reviewed-by: Robert Findley <rfin...@google.com>
---
M cmd/toolstash/buildall
M gopls/internal/hooks/gen-licenses.sh
2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/cmd/toolstash/buildall b/cmd/toolstash/buildall
index 0c6492c..4fc22f7 100755
--- a/cmd/toolstash/buildall
+++ b/cmd/toolstash/buildall
@@ -38,10 +38,10 @@
fi

targets="$(go tool dist list; echo linux/386/softfloat)"
-targets="$(echo "$targets" | tr '/' '-' | sort | egrep "$pattern" | egrep -v 'android-arm|darwin-arm')"
+targets="$(echo "$targets" | tr '/' '-' | sort | grep -E "$pattern" | grep -E -v 'android-arm|darwin-arm')"

# put linux first in the target list to get all the architectures up front.
-targets="$(echo "$targets" | egrep 'linux') $(echo "$targets" | egrep -v 'linux')"
+targets="$(echo "$targets" | grep -E 'linux') $(echo "$targets" | grep -E -v 'linux')"

if [ "$sete" = true ]; then
set -e
diff --git a/gopls/internal/hooks/gen-licenses.sh b/gopls/internal/hooks/gen-licenses.sh
index 7d6bab7..c35c912 100755
--- a/gopls/internal/hooks/gen-licenses.sh
+++ b/gopls/internal/hooks/gen-licenses.sh
@@ -27,7 +27,7 @@
for mod in $mods; do
# Find the license file, either LICENSE or COPYING, and add it to the result.
dir=$(go list -m -f {{.Dir}} $mod)
- license=$(ls -1 $dir | egrep -i '^(LICENSE|COPYING)$')
+ license=$(ls -1 $dir | grep -E -i '^(LICENSE|COPYING)$')
echo "-- $mod $license --" >> $tempfile
echo >> $tempfile
sed 's/^-- / &/' $dir/$license >> $tempfile

To view, visit change 432295. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Ib37f5b244ead4c2d46078bea34d4cb6363c48b1b
Gerrit-Change-Number: 432295
Gerrit-PatchSet: 3
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: shuang cui <imc...@gmail.com>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages