Skip to content

Commit 6c2e2b3

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 586d75a commit 6c2e2b3

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
@@ -69,7 +69,7 @@ else
6969
echo '%%' > conftest.l
7070
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
7171
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
72-
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;}'
72+
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;}'
7373
then
7474
pgac_cv_path_flex=$pgac_candidate
7575
break 2

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7444,7 +7444,7 @@ else
74447444
echo '%%' > conftest.l
74457445
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
74467446
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7447-
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;}'
7447+
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;}'
74487448
then
74497449
pgac_cv_path_flex=$pgac_candidate
74507450
break 2
@@ -7542,7 +7542,7 @@ if test "$PERL"; then
75427542
{ $as_echo "$as_me:$LINENO: using perl $pgac_perl_version" >&5
75437543
$as_echo "$as_me: using perl $pgac_perl_version" >&6;}
75447544
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7545-
$AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
7545+
$AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
75467546
then
75477547
{ $as_echo "$as_me:$LINENO: WARNING:
75487548
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.

0 commit comments

Comments
 (0)