Re: BUG #5339: Version of Perl detected incorrectly

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: BUG #5339: Version of Perl detected incorrectly
Дата
Msg-id 34d269d41002221317x609346fbs56fd928a72e3d772@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #5339: Version of Perl detected incorrectly  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #5339: Version of Perl detected incorrectly
Re: BUG #5339: Version of Perl detected incorrectly
Re: BUG #5339: Version of Perl detected incorrectly
Список pgsql-bugs
On Mon, Feb 22, 2010 at 13:07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alex Hunsaker <badalex@gmail.com> writes:
>> ! =C2=A0 perl_version_error=3D`$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. =C2=A0Try it in perl 4...

Well I would if I had it sitting around =3D).  I did try to compile
one... but chickened out as soon as I hit an error:
$ make
`sh  cflags perly.o` perly.c
      CCCMD =3D  cc -c  -O
In file included from perly.y:38:
perl.h:279: error: conflicting types for =E2=80=98sys_errlist=E2=80=99
/usr/include/bits/sys_errlist.h:28: note: previous declaration of
=E2=80=98sys_errlist=E2=80=99 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=3D`$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 =3D 5 && $2 >=3D 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 PostgreS=
QL.
! *** 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 PostgreS=
QL.
! *** Perl version 5.8 or later is required, but this is
$pgac_perl_version." >&2;}
      PERL=3D""
    fi
  fi
--- 6867,6885 ----
  fi

  if test "$PERL"; then
!   perl_version_error=3D""
!   if $PERL -v 2>/dev/null | grep -q 'This is perl, v4' 2>/dev/null; then
!     perl_version_error=3D"Perl version 5.8 or later is required, but
this is perl v4"
!   else
!     perl_version_error=3D`$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 PostgreS=
QL.
! *** $perl_version_error." >&5
  $as_echo "$as_me: WARNING:
  *** The installed version of Perl, $PERL, is too old to use with PostgreS=
QL.
! *** $perl_version_error." >&2;}
      PERL=3D""
    fi
  fi


Thoughts?

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5339: Version of Perl detected incorrectly
Следующее
От: David Fetter
Дата:
Сообщение: Re: BUG #5339: Version of Perl detected incorrectly