[nasm:master] autogen.sh: don't rely on sed -r

nasm-bot for H. Peter Anvin hpa at zytor.com
Sun Jul 12 06:09:03 PDT 2020


Commit-ID:  b9a44fcdf0b0557a91082dc600a201bd06663484
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=b9a44fcdf0b0557a91082dc600a201bd06663484
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sat, 11 Jul 2020 21:21:54 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Sun, 12 Jul 2020 06:03:58 -0700

autogen.sh: don't rely on sed -r

Not all versions of sed has "sed -r", so change it to use basic
regular expressions. Furthermore, not all systems support \| in basic
regular expressions, to work around it by converting the script names
explicitly.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 autogen.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 5597c8a0..d1ca83db 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -20,11 +20,14 @@ if test ! x"$autolib" = x; then
     for prg in install-sh compile config.guess config.sub; do
 	# Update autoconf helpers if and only if newer ones are available
 	if test -f "$autolib"/"$prg" && \
-		( test -f "$autolib"/"$prg" && \
-		      sed -n -r -e \
-			  's/^(scriptver(|sion)|timestamp)=['\''"]?([^'\''"]+).*$/\3/p' \
+		( set -e ; \
+		  test -f autoconf/helpers/"$prg" && sed -n \
+		    -e 's/^scriptver=/scriptversion=/' \
+		    -e 's/^timestamp=/scriptversion=/' \
+		    -e 's/^scriptversion=['\''"]?\([^'\''"]*\).*$/\1/p' \
 			  "$autolib"/"$prg" autoconf/helpers/"$prg" | \
-			  sort --check=quiet; test $? -ne 0 )
+			  sort -c 2>/dev/null ; \
+		  test $? -ne 0 )
 	then
 	    cp -f "$autolib"/"$prg" autoconf/helpers
 	fi


More information about the Nasm-commits mailing list