8000 Fix configure's incorrect version tests for flex and perl. · prmdeveloper/postgres@1ba8745 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ba8745

Browse files
committed
Fix configure's incorrect version tests for flex and perl.
awk's equality-comparison operator is "==" not "=". We got this right in many places, but not in configure's checks for supported version numbers of flex and perl. It hadn't been noticed because unsupported versions are so old as to be basically extinct in the wild, and because the only consequence is whether or not a WARNING flies by during configure. Daniel Gustafsson noted the problem with respect to the test for flex, I found the other by reviewing other awk calls.
1 parent a840c14 commit 1ba8745

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

config/perl.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if test "$PERL"; then
1313
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']`
1414
AC_MSG_NOTICE([using perl $pgac_perl_version])
1515
if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
16-
$AWK '{ if ([$]1 = 5 && [$]2 >= 8) exit 1; else exit 0;}'
16+
$AWK '{ if ([$]1 == 5 && [$]2 >= 8) exit 1; else exit 0;}'
1717
then
1818
AC_MSG_WARN([
1919
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.

config/programs.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ else
7777
echo '%%' > conftest.l
7878
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
7979
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
80-
if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 = 2 && ([$]2 > 5 || ([$]2 = 5 && [$]3 >= 31))) exit 0; else exit 1;}'
80+
if echo "$pgac_flex_version" | sed ['s/[.a-z]/ /g'] | $AWK '{ if ([$]1 == 2 && ([$]2 > 5 || ([$]2 == 5 && [$]3 >= 31))) exit 0; else exit 1;}'
8181
then
8282
pgac_cv_path_flex=$pgac_candidate
8383
break 2

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7243,7 +7243,7 @@ else
72437243
echo '%%' > conftest.l
72447244
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
72457245
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7246-
if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 = 2 && ($2 > 5 || ($2 = 5 && $3 >= 31))) exit 0; else exit 1;}'
7246+
if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && ($2 > 5 || ($2 == 5 && $3 >= 31))) exit 0; else exit 1;}'
72477247
then
72487248
pgac_cv_path_flex=$pgac_candidate
72497249
break 2
@@ -7341,7 +7341,7 @@ if test "$PERL"; then
73417341
{ $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
73427342
$as_echo "$as_me: using perl $pgac_perl_version" >&6;}
73437343
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7344-
$AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
7344+
$AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
73457345
then
73467346
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
73477347
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.

0 commit comments

Comments
 (0)
0