about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-03-23 09:27:27 -0500
committerAlex Crichton <alex@alexcrichton.com>2018-03-23 10:16:11 -0700
commit3624544a535209dec4c1a2dc3eb7e39e7fb43f6e (patch)
treec95b00ab87163d4baf0fee1f4ab333e25e8fe08a
parent6fd3cc585a0d09bce600f345c27f1ebb7a2e06b8 (diff)
parentde1c929adaeb5b1e466b6f8485a9f7cf92969185 (diff)
Rollup merge of #49272 - semarie:cat-and-grep-gnu, r=alexcrichton
Use GNU version of fgrep/egrep tool if available

It is mostly for BSD system. Some tests (run-make/issue-35164 and
run-make/cat-and-grep-sanity-check) are failing with BSD
fgrep, whereas they pass with gnu version (gfgrep).
-rwxr-xr-xsrc/etc/cat-and-grep.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/etc/cat-and-grep.sh b/src/etc/cat-and-grep.sh
index ef9884d2e98..361e8d8e60e 100755
--- a/src/etc/cat-and-grep.sh
+++ b/src/etc/cat-and-grep.sh
@@ -63,6 +63,11 @@ done
 
 shift $((OPTIND - 1))
 
+# use gnu version of tool if available (for bsd)
+if command -v "g${GREPPER}"; then
+    GREPPER="g${GREPPER}"
+fi
+
 LOG=$(mktemp -t cgrep.XXXXXX)
 trap "rm -f $LOG" EXIT