[HEADS UP] PostgreSQL ports split into -server & -client

Palle Girgensohn girgen at FreeBSD.org
Tue Feb 1 15:53:04 PST 2005


--On tisdag, februari 01, 2005 05.34.47 +0200 Ion-Mihai Tetcu 
<itetcu at people.tecnik93.com> wrote:

>  [ Palle, sorry, I forgot to cc ports@ ]
>
> On Tue, 01 Feb 2005 03:39:57 +0100
> Palle Girgensohn <girgen at FreeBSD.org> wrote:
>
>  [ ... ]
>
>> Hi,
>>
>> I've looked at this a bit more. Here's how it works, more or less:
>>
>> Setting USE_PGSQL=yes is equivalent to setting
>> LIB_DEPENDS=pq:${PORTSDIR}/databases/postgresql${PGSQL_VER}-client
>>
>> where PGSQL_VER is
>>
>>   WANT_PGSQL_VER if set
>> else
>>   existing installed version of postgresql client (if it is installed)
>> else
>>   DEFAULT_PGSQL_VER (defaults to conservative 74)
>>
>> So, if postgresql-7.4.6 is installed, and you set WANT_PGSQL_VER=80,
>> what  will happen?
>>
>> Well, you will have
>> LIB_DEPENDS=pq:${PORTSDIR}/databases/postgresql80-client
>>
>> Anyone just a little more than remotely familiar with the ports system
>> knows that this will not install a new postgresql version 8.0, since
>> LIB_DEPENDS will find the libpq.so (from the existing pg-7.4.6
>> installation),
>
> That's way I was checking against another lib (ecpg.4) in my port to
> differentiate between 73 and 74.

That was probably clever. My point is that there are very few ports that 
won't work just fine with any of the version 7.3.x, 7.4.x or 8.0.x, so you 
hardly ever need WANT_PGSQL_VER. The exception are almost all depending on 
a specific *server* version, and that's a different matter altogether. 
USE_PGSQL is for client dependencies only.

As long as a port doesn't use WANT_PGSQL_VER, everything will work 
smoothly. Just install the version of postgresql you want first, or trust 
the default (7.4 at the moment).

With WANT_PGSQL_VER *and* some version already installed, there seem to be 
a bug, I will have to fix that I guess...

>> build and link against that lib, and then register a (false)
>> port dependency to the not installed postgresql80-client port instead.
>
> Maybe you should do the check like MySQL ( see _MYSQL_VER ) to prevent
> this ?

Maybe, but see my argument for not doing like MySQL at the bottom of this 
email.


>> Maybe this is not optimal, but this is how the ports collection works.
>
> I keep wondering if we shouldn't check first for the pkg-info and then
> that the file actually exists or something like that. After all, we do
> assume pkg information is correct.

pkg_info would yield correct info, but it would probably mean forking 
during INDEX build, and that is strictly forbidden for performance reasons. 
:(  OTH, pg_config should also yields correct info.


>>  I've designed this so that the USE_PGSQL=yes normally is all you need
>>  in a port.  Unless you specify WANT_PGSQL_VER or BROKEN_WITH_PGSQL, it
>> will pick up the  installed version of postgresql and add dependencies
>> for that version, or  install the default version if none is installed.
>> It will not work  perfectly when you have one version installed and the
>> port wants another.  It will keep your version, which is the most
>> important part. It might fail  to warn that about the problem, and this
>> is an issue I have to look into, I  guess.
>
>  :-) we need a way to protect us about this; it is possible that one
> port will not work (or compile) with the wrong PGSQL version; but the
> LIB check, as you say, won't yield this.
>
>> I have shamelessly snatched much of mysql's entry in bsd.ports.mk for
>> the  USE_PGSQL knob. Using a WITH_PGSQL_VER is something I did not
>> adopt,  though, partly because it is rarely needed with postgresql (most
>> stuff  works on all versions) but mostly because WITH_ knobs should not
>> go inte  bsd.ports.mk, IMO, they should be reserved to use in ports.
>
> Well, I don't argue for the name of the knob, is its functionality that
> I'm after :)

Heh, naturally, that was really a bad argument, sorry :-D

I'll think of something better... ;^)

>  [ ... ]
>
>> In short: If you want a certain version of postgresql, just install it
>> and  you're set, everything should work fine from that point. ports only
>> need a  USE_PGSQL=yes.
>
> Yes, no argument here. I was just trying to be user friendly.

Of course, and I appreciate that you spend time discussing this issue!

I'll do some more testing wrt WANT_PGSQL_VER.

Cheers,
Palle¨


 


More information about the freebsd-ports mailing list