From 80d05c3483404ea6bc292a996bbbeccf9497ee59 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 19 Sep 2022 13:25:45 -0700 Subject: [PATCH] libtool: port better to POSIX grep 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 | 2 +- tests/libtool.at | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cdemo.at b/tests/cdemo.at index cc6d97656..ca80383af 100644 --- a/tests/cdemo.at +++ b/tests/cdemo.at @@ -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 diff --git a/tests/libtool.at b/tests/libtool.at index a03812a47..9e69c80cc 100755 --- a/tests/libtool.at +++ b/tests/libtool.at @@ -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]) -- 2.47.3