On Mon, Feb 22, 2010 at 14:31, Tom Lane <t...@sss.pgh.pa.us> wrote: > I'm inclined to stay with the same basic > implementation and just hack up the regexp some more to cope with 5.11's > more verbose -v output.
And here is a stab at that: $ echo "This is perl, version 4.0" | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[\.0-9]*\).*$/\1/p' 4.0 $ echo "This is perl, v5.8.0" | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[\.0-9]*\).*$/\1/p' 5.8.0 $ echo "This is perl, v5.10.1" | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[\.0-9]*\).*$/\1/p' 5.10.1 $ echo "This is perl 5, version 11, subversion 4 (v5.11.4-114-ga4cc961*) built for" | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[\.0-9]*\).*$/\1/p' 5.11.4 --- *** config/perl.m4 --- config/perl.m4 *************** *** 10,16 **** 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/ .*//']` 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;}' --- 10,16 ---- fi if test "$PERL"; then ! pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[a-z ]*\([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;}' *** configure --- configure *************** *** 6867,6873 **** 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/ .*//'` { $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' | \ --- 6867,6873 ---- fi if test "$PERL"; then ! pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl.*v[a-z ]*\([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' | \ -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs