Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Feb 2005 05:34:47 +0200
From:      Ion-Mihai Tetcu <itetcu@people.tecnik93.com>
To:        Palle Girgensohn <girgen@FreeBSD.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: [HEADS UP] PostgreSQL ports split into -server &	-client
Message-ID:  <20050201053447.60781fd8@it.buh.tecnik93.com>
In-Reply-To: <2992741329D5A6EBD8D20A79@palle.girgensohn.se>
References:  <E200B81EA7454A9AFA88A1CF@palle.girgensohn.se> <E200B81EA7454A9AFA88A1CF@palle.girgensohn.se> <20050131025453.GA81974@nowhere> <Tfhyg1zblY@dmeyer.dinoex.sub.org> <20050131153816.128e4623@it.buh.tecnik93.com> <F06BEBCACCAC1B598D4B7D4D@rambutan.pingpong.net> <20050131170126.43e2dc78@it.buh.tecnik93.com> <2992741329D5A6EBD8D20A79@palle.girgensohn.se>

next in thread | previous in thread | raw e-mail | index | archive | help
 [ Palle, sorry, I forgot to cc ports@ ]

On Tue, 01 Feb 2005 03:39:57 +0100
Palle Girgensohn <girgen@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.

> 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 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.

>  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 :)

 [ ... ]

> 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.


-- 
IOnut
Unregistered ;) FreeBSD "user"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050201053447.60781fd8>