Bug 200569 - Mk/Uses/pgsql.mk: Version detection does not work properly
Summary: Mk/Uses/pgsql.mk: Version detection does not work properly
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Max Khon
URL:
Keywords: needs-patch, needs-qa
: 204031 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-06-01 11:25 UTC by Max Khon
Modified: 2016-03-17 12:09 UTC (History)
5 users (show)

See Also:
koobs: maintainer-feedback? (pgsql)


Attachments
Try to use installed postgresql-client version before falling back to PGSQL_DEFAULT (1.28 KB, patch)
2015-06-01 11:25 UTC, Max Khon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Khon freebsd_committer 2015-06-01 11:25:12 UTC
Created attachment 157340 [details]
Try to use installed postgresql-client version before falling back to PGSQL_DEFAULT

Currently PGSQL_DEFAULT is 9.3.
When a different version of postgresql-client is installed (e.g. 9.0) and port has pgsql:9.0+ pgsql.mk select a default version instead of installed version.

Example:

fjoe@slinky:/usr/ports/databases/pgadmin3 % make
===>  pgadmin3-1.20.0 cannot install: the port wants postgresql-client version 9.0 9.1 9.2 9.3 9.4 and you have version 9.0 installed.
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/pgadmin3
fjoe@slinky:/usr/ports/databases/pgadmin3 % pkg info | grep postgresql
postgresql90-client-9.0.18     PostgreSQL database (client)
fjoe@slinky:/usr/ports/databases/pgadmin3 % 

This happens because _WANT_PGSQL_VER code in pgsql.mk does not take into account the installed version and always tries to use PGSQL_DEFAULT.
Comment 1 Max Khon freebsd_committer 2015-06-01 15:10:20 UTC
I had to revert pgadmin3 to IGNORE_WITH_PGSQL because users started to complain that the build breaks if they have non-default postgresql-client installed (similar to mine breakage):

===>  pgadmin3-1.20.0 cannot install: the port wants postgresql-client
version 9.0 9.1 9.2 9.3 9.4 and you have version 9.4 installed.
*** Error code 1
Comment 2 Chris Hutchinson 2015-11-02 18:28:34 UTC
See also:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204031

It appears that Postgresql is no longer maintained? This
issue is nearly 6 months running. :(
Won't this issue affect a great many ports?
Comment 3 Palle Girgensohn freebsd_committer 2015-11-02 23:38:33 UTC
Hi,

I have not seen this problem at all, and I'm running 9.4.

Did you set DEFAULT_VERSIONS= pgsql=9.4 in /etc/make.conf?

Perhaps this is not properly documented? The DEFAULT_VERSIONS is not exclusive to PostgreSQL though.

Palle
Comment 4 commit-hook freebsd_committer 2016-02-10 12:19:13 UTC
A commit references this bug:

Author: fjoe
Date: Wed Feb 10 12:18:20 UTC 2016
New revision: 408625
URL: https://svnweb.freebsd.org/changeset/ports/408625

Log:
  Prefer installed version instead of insisting on using default version.

  PR:		200569

Changes:
  head/Mk/Uses/pgsql.mk
Comment 5 Max Khon freebsd_committer 2016-02-10 12:20:12 UTC
*** Bug 204031 has been marked as a duplicate of this bug. ***
Comment 6 commit-hook freebsd_committer 2016-03-17 12:09:50 UTC
A commit references this bug:

Author: fjoe
Date: Thu Mar 17 12:09:39 UTC 2016
New revision: 411273
URL: https://svnweb.freebsd.org/changeset/ports/411273

Log:
  Fix installed version check on FreeBSD 9.

  PR:		200569

Changes:
  head/Mk/Uses/pgsql.mk