]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: port better to POSIX grep
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 19 Sep 2022 20:25:45 +0000 (13:25 -0700)
committerMike Frysinger <vapier@gentoo.org>
Sun, 14 Jan 2024 03:59:34 +0000 (22:59 -0500)
This fixes some other regular expressions that GNU grep 3.8 does not
warn about (I found them with an even-pickier 'grep').

I did not look systematically for all portability bugs of this form.

Url: https://savannah.gnu.org/patch/index.php?10282

* tests/cdemo.at (allow_undefined_flag):
Prefer } to \} in EREs, as \} is not portable.
* tests/libtool.at (quote shell meta-characters in filenames):
Prefer ] to \] in BREs, as \] is not portable.

tests/cdemo.at
tests/libtool.at

index cc6d976562baf984859dd82b489b02f7080b5986..ca80383af86e8ed23eaf370171bfa00637affbcc 100644 (file)
@@ -184,7 +184,7 @@ _LT_SETUP
 
 LT_AT_CHECK_CONFIG([--disable-static])
 
-AT_CHECK([$EGREP "^allow_undefined_flag=.\{0,1\}unsupported.\{0,1\}$" libtool && (exit 77)],
+AT_CHECK([$EGREP "^allow_undefined_flag=.\{0,1}unsupported.\{0,1}$" libtool && (exit 77)],
           1, [ignore])
 
 $SED 's|allow_undefined=no|allow_undefined=yes|g' libtool > ltnew && mv -f ltnew libtool
index a03812a472264c1bf6bb22f73048b53ceb57f88c..9e69c80cc022d467e17bf75eaac89c1ae0527490 100755 (executable)
@@ -128,7 +128,7 @@ for mode in compile link install; do
 
   # Shell metacharacters that should be double quoted by libtool, and need
   # backslash escaping for input to grep.
-  for mchar in "@<:@" "@:>@" "^" "*"; do
+  for mchar in "@<:@" "^" "*"; do
 
     AT_CHECK([$LIBTOOL -n --mode=$mode $preargs $preflag"$flag$mchar:test$mchar" $postargs],
             [0], [stdout])
@@ -137,7 +137,7 @@ for mode in compile link install; do
 
   # Metacharacters that should be double quoted by libtool, but which are
   # not special to grep (NOTE: Some of these ARE special to $EGREP!!).
-  for mchar in "~" "#" "&" "(" ")" "{" "}" "|" ";" "<" ">" "?" "'" " " "       "; do
+  for mchar in "~" "#" "&" "(" ")" "@:>@" "{" "}" "|" ";" "<" ">" "?" "'" " " "        "; do
 
     AT_CHECK([$LIBTOOL -n --mode=$mode $preargs $preflag"$flag$mchar:test$mchar" $postargs],
             [0], [stdout])