Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d7b129

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 37d0c2c commit 7d7b129

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

config/perl.m4

+1-1
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

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -7358,7 +7358,7 @@ else
73587358
echo '%%' > conftest.l
73597359
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
73607360
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7361-
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;}'
7361+
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;}'
73627362
then
73637363
pgac_cv_path_flex=$pgac_candidate
73647364
break 2
@@ -7456,7 +7456,7 @@ if test "$PERL"; then
74567456
{ $as_echo "$as_me:${as_lineno-$LINENO}: using perl $pgac_perl_version" >&5
74577457
$as_echo "$as_me: using perl $pgac_perl_version" >&6;}
74587458
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7459-
$AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
7459+
$AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
74607460
then
74617461
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
74627462
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.

0 commit comments

Comments
 (0)