OSDN Git Service

Fix configure's regexp for extracting the Perl version number from perl -v
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 23 Feb 2010 18:35:07 +0000 (18:35 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 23 Feb 2010 18:35:07 +0000 (18:35 +0000)
output.  Per bug #5339, Perl 5.11 has changed the format of that output
enough to break the previous coding.

Alex Hunsaker

config/perl.m4
configure

index 045204b..165034b 100644 (file)
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/config/perl.m4,v 1.8 2010/02/22 21:16:50 momjian Exp $
+# $PostgreSQL: pgsql/config/perl.m4,v 1.9 2010/02/23 18:35:06 tgl Exp $
 
 
 # PGAC_PATH_PERL
@@ -10,7 +10,7 @@ if test -z "$PERL"; then
 fi
 
 if test "$PERL"; then
-  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl, v[a-z ]*//p'] | sed ['s/ .*//']`
+  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']`
   AC_MSG_NOTICE([using perl $pgac_perl_version])
   if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
     $AWK '{ if ([$]1 = 5 && [$]2 >= 8) exit 1; else exit 0;}'
index f5a9325..94c5063 100755 (executable)
--- a/configure
+++ b/configure
@@ -6867,7 +6867,7 @@ fi
 fi
 
 if test "$PERL"; then
-  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl, v[a-z ]*//p' | sed 's/ .*//'`
+  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'`
   { $as_echo "$as_me:$LINENO: using perl $pgac_perl_version" >&5
 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \