libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] question mark is extended regex for non-GNU grep


From: Michael Haubenwallner
Subject: [PATCH] question mark is extended regex for non-GNU grep
Date: Fri, 21 Nov 2014 13:11:13 +0100

Accepting \? for at-most-once in basic regex is a GNU grep extension,
not accepted by AIX grep for example.
* tests/libtool.at: Need EGREP for ? operator, and ? without \ then.
With EGREP, need one more \ for $.
---
 tests/libtool.at | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/libtool.at b/tests/libtool.at
index a466790..04655dd 100755
--- a/tests/libtool.at
+++ b/tests/libtool.at
@@ -116,14 +116,15 @@ for mode in compile link install; do
           [0], [stdout])
   # NOTE: we use "..."'"'"..." to insert a literal quote into the expression
   #       because "...\"..." is not expanded consistently by all shells.
-  AT_CHECK([$GREP 
"$mode:.*$match_preflag"'"\?'"$flag\\\\\\\\:test\\\\\\\\"'"\? ' stdout],
+  AT_CHECK([$EGREP "$mode:.*$match_preflag"'"?'"$flag\\\\\\\\:test\\\\\\\\"'"? 
' stdout],
              [0], [ignore])
 
   # Shell metacharacters that should be backslashified by libtool.
   for mchar in \" \` \$; do
     AT_CHECK([$LIBTOOL -n --mode=$mode $preargs 
$preflag"$flag$mchar:test$mchar" $postargs],
             [0], [stdout])
-    AT_CHECK([$GREP 
"$mode:.*$match_preflag"'"'"\?$flag\\\\$mchar:test\\\\$mchar"'"'"\? " stdout], 
[0], [ignore])
+    test \$ = "$mchar" && mchar="\\$mchar" # for $EGREP
+    AT_CHECK([$EGREP 
"$mode:.*$match_preflag"'"'"?$flag\\\\$mchar:test\\\\$mchar"'"'"? " stdout], 
[0], [ignore])
   done
 
   # Shell metacharacters that should be double quoted by libtool, and need
-- 
1.8.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]