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-22 21:17:57
Message-ID: 34d269d41002221317x609346fbs56fd928a72e3d772@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Feb 22, 2010 at 13:07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Alex Hunsaker <badalex(at)gmail(dot)com> writes:
>> !   perl_version_error=`$PERL -e 'use 5.00801;' 2>&1`
>
> This is not a path towards an acceptable solution, as it effectively
> assumes what we are setting out to prove, namely that we have found
> a reasonably modern version of perl.  Try it in perl 4...

Well I would if I had it sitting around =). I did try to compile
one... but chickened out as soon as I hit an error:
$ make
`sh cflags perly.o` perly.c
CCCMD = cc -c -O
In file included from perly.y:38:
perl.h:279: error: conflicting types for ‘sys_errlist’
/usr/include/bits/sys_errlist.h:28: note: previous declaration of
‘sys_errlist’ was here
In file included from perl.h:540,
from perly.y:38:
arg.h:685:1: warning: "AF_LOCAL" redefined
In file included from /usr/include/sys/socket.h:40,
from /usr/include/netinet/in.h:25,
from perl.h:224,
from perly.y:38:
/usr/include/bits/socket.h:116:1: warning: this is the location of the
previous definition

How about something like the below? Basically If we find "This is
perl v4" we bail right then. Otherwise we use the version check I
proposed up-thread? I may have inadvertently used some
bash/gnu-isms... sorry about that.

*** a/configure
--- b/configure
***************
*** 6867,6884 **** 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' | \
! $AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
! then
{ $as_echo "$as_me:$LINENO: WARNING:
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
! *** Perl version 5.8 or later is required, but this is
$pgac_perl_version." >&5
$as_echo "$as_me: WARNING:
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
! *** Perl version 5.8 or later is required, but this is
$pgac_perl_version." >&2;}
PERL=""
fi
fi
--- 6867,6885 ----
fi

if test "$PERL"; then
! perl_version_error=""
! if $PERL -v 2>/dev/null | grep -q 'This is perl, v4' 2>/dev/null; then
! perl_version_error="Perl version 5.8 or later is required, but
this is perl v4"
! else
! perl_version_error=`$PERL -e 'use 5.00801;' 2>&1`
! fi
! if test -n "$perl_version_error"; then
{ $as_echo "$as_me:$LINENO: WARNING:
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
! *** $perl_version_error." >&5
$as_echo "$as_me: WARNING:
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
! *** $perl_version_error." >&2;}
PERL=""
fi
fi

Thoughts?

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Fetter 2010-02-22 21:30:32 Re: BUG #5339: Version of Perl detected incorrectly
Previous Message Tom Lane 2010-02-22 21:07:15 Re: BUG #5339: Version of Perl detected incorrectly