]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not use escape codes for matching with grep
authorMichal Nowak <mnowak@isc.org>
Thu, 13 May 2021 15:52:31 +0000 (17:52 +0200)
committerMichal Nowak <mnowak@isc.org>
Mon, 17 May 2021 11:14:31 +0000 (13:14 +0200)
FreeBSD 13.0 replaced GNU grep with BSD grep and removed support for
"redundant escapes for most ordinary characters" from regex(3) library,
therefore the matching sequence in digdelv/tests.sh needs to be
rewritten otherwise it fails with:

    grep: trailing backslash (\)

(cherry picked from commit 253ae96bf107ee7a834a4f07911cc84b71e76a1d)

bin/tests/system/digdelv/tests.sh

index 21090013ab74fe4404e11eb3a0c96e44475e57cd..dc629c0be8a2adb9550650ad6c8d5fb43240ebc9 100644 (file)
@@ -664,7 +664,8 @@ ret=0
   echo_i "check that dig +bufsize=0 +edns sends EDNS with bufsize of 0 ($n)"
   ret=0
   $DIG $DIGOPTS @10.53.0.3 a.example +bufsize=0 +edns +qr > dig.out.test$n 2>&1 || ret=1
-  grep -E 'EDNS:.* udp: 0\r{0,1}$' dig.out.test$n > /dev/null|| ret=1
+  pat='EDNS:.* udp: 0$'
+  tr -d '\r' < dig.out.test$n | grep -E "$pat" > /dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=`expr $status + $ret`