Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL
Date
Msg-id 15919.1493130489@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> On Tue, Apr 25, 2017 at 2:57 PM, Andres Freund <andres@anarazel.de> wrote:
>> Any chance of formulating these in a version agnostic way, instead of
>> copying the same stanza for every version?  E.g. using a wildcard or
>> such...

> Using glob() would be enough for this purpose.

Not really, because glob() wouldn't enforce any preference over which
of multiple versions to pick.  If anything, it would do exactly the
wrong thing, preferring an older tclsh version over a newer one.

But I agree with Andres' complaint that just duplicating the code isn't
the best way.  The configure script has a loop that's basically like

for f in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84 tclsh8.3 tclsh83
do  ... break if $f is the right one
done

Seems to me that a similar coding pattern in the MSVC script is a
reasonable way to go.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PG 10 release notes
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Link to commits in PG 10 release notes