10000 Fix configure's incorrect version tests for flex and perl. · eldilibra/postgres@6e3702e · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e3702e

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 c2c19af commit 6e3702e

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
@@ -7193,7 +7193,7 @@ else
71937193
echo '%%' > conftest.l
71947194
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
71957195
pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
7196-
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;}'
7196+
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;}'
71977197
then
71987198
pgac_cv_path_flex=$pgac_candidate
71997199
break 2
@@ -7291,7 +7291,7 @@ if test "$PERL"; then
72917291
{ $as_echo "$as_me:$LINENO: using perl $pgac_perl_version" >&5
72927292
$as_echo "$as_me: using perl $pgac_perl_version" >&6;}
72937293
if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
7294-
$AWK '{ if ($1 = 5 && $2 >= 8) exit 1; else exit 0;}'
7294+
$AWK '{ if ($1 == 5 && $2 >= 8) exit 1; else exit 0;}'
72957295
then
72967296
{ $as_echo "$as_me:$LINENO: WARNING:
72977297
*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.

0 commit comments

Comments
 (0)
0