Page MenuHomeFreeBSD

Uses/pgsql.mk: PostgreSQL option to install a version between an interval
ClosedPublic

Authored by lbartoletti on Jan 11 2019, 9:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 3:45 PM
Unknown Object (File)
Thu, Apr 11, 7:20 PM
Unknown Object (File)
Wed, Apr 10, 6:33 PM
Unknown Object (File)
Wed, Apr 10, 6:27 PM
Unknown Object (File)
Thu, Mar 28, 5:28 AM
Unknown Object (File)
Feb 21 2024, 5:47 PM
Unknown Object (File)
Jan 24 2024, 11:15 PM
Unknown Object (File)
Dec 21 2023, 11:23 PM

Details

Summary

As a postgis maintainer and other tools relying on postgresql, I need to define an interval for postgresql. This allows you to avoid errors like this one at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234813

I had proposed this patch in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213038 but it was not followed.

I propose this patch independently.

Once approved, I will modify my ports requiring intervals and update the documentation.

Thank you.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

crees requested changes to this revision.Jan 11 2019, 12:18 PM

I think this should work-- how have you tested this?

Uses/pgsql.mk
10 ↗(On Diff #52760)

Please would you document it too? I'll deal with the Porter's Handbook bit.

84 ↗(On Diff #52760)

_MIN=${pgsql_ARGS:M?*-?*:C,-.*,,}

Should work, but please test. Use ?* because * matches the empty string, which isn't a problem because of the elif but the test is incorrect; would match *- as well.

This revision now requires changes to proceed.Jan 11 2019, 12:18 PM

I think this should work-- how have you tested this?

Yes, with some test on a fake port. However, I didn't try to compile all the ports using pgsql.mk

For example with pgsql9.5 installed and a port with

USES= pgsql:9.3-9.4

I get

version 9.3 9.4 and you have version 9.5 installed.
*** Error code 1

Stop.
USES= pgsql:9.6-11

The result is:

version 9.6 10 11 and you have version 9.5 installed.
*** Error code 1

Stop.

If I write:

USES= pgsql:9.6-9.3

I get:

The minimum version must be higher than the maximum version wanted.
*** Error code 1

Stop.

And if no pgsql is installed

USES= pgsql:9.6-11

installs postgresql9.6

lbartoletti retitled this revision from PostgreSQL option to install a version between an interval to PostgreSQL option to install a version between an interval.

Rewriting documentation on version options. Application of the @crees suggestion for MIN

Please get the MAX fixed too and it's great.

Uses/pgsql.mk
93 ↗(On Diff #52774)

If you do this one too I'll commit it :)

This revision is now accepted and ready to land.Jan 11 2019, 6:22 PM

Change substitution also for MAX

This revision now requires review to proceed.Jan 11 2019, 7:43 PM
lbartoletti added inline comments.
Uses/pgsql.mk
93 ↗(On Diff #52774)

Oh yes, sorry!
Thank you :)

linimon retitled this revision from PostgreSQL option to install a version between an interval to Uses/pgsql.mk: PostgreSQL option to install a version between an interval.Jan 15 2019, 4:22 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 15 2019, 9:51 PM
This revision was automatically updated to reflect the committed changes.

Committed, thanks!

Uses/pgsql.mk
98 ↗(On Diff #52779)

Point of curiosity, in former versions of make it had to be written as ${_MIN} <= ${version}

If you're ever writing portable code that's worth remembering:

https://www.freebsd.org/cgi/man.cgi?query=make&apropos=0&sektion=1&manpath=FreeBSD+8.3-RELEASE&arch=default&format=html#end