Re: BUG #5339: Version of Perl detected incorrectly

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jonathan <jonathan(at)leto(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5339: Version of Perl detected incorrectly
Date: 2010-02-23 07:50:14
Message-ID: 34d269d41002222350s2affabbcr6fb60e862da481be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Feb 22, 2010 at 14:31, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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' | \

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alex Hunsaker 2010-02-23 07:51:52 Re: BUG #5339: Version of Perl detected incorrectly
Previous Message tomas 2010-02-23 07:05:37 Re: BUG #5341: problema al iniciar pgadmin