conflicting dependency

Chuck Swiger cswiger at
Thu Jul 20 14:44:55 UTC 2006

John E Hein wrote:
> Chuck Swiger wrote at 09:39 -0400 on Jul 20, 2006:
>> John E Hein wrote:
>> > Let's say there are two ports A & B.
>> > They both provide (and so register CONFLICTS with each other).
>> > 
>> > Now port C wants to use libfoo (and doesn't care if it gets it
>> > from A or B).
>> > 
>> > What does port C list in it's LIB_DEPENDS?
>> Whichever one the author of port C chooses.
>> Quite often, at least for things like the BerkeleyDB, the author of port C 
>> will provide tunable OPTIONS or WITH_ or WITHOUT_ flags that you as the user 
>> of the port can tune to choose a particular version that you like.
> Just for purposes of clarification, in this example, for purposes of
> what C wants libfoo for, either libfoo from A or B will do.  C doesn't
> care.

That's right.  Plenty of software will work with anything from BDB-1.85 
through 4.x, for example.

>>> What if it lists A and someone installs B... does A get registered as
>>> the dependency when C is installed even though A is not installed?
>> No, the port should be registered against B and not A, if B is installed.
> I agree.  It should.  But how does the ports infrastructure accomplish
> that?

It uses pkg_which to figure out which port the file being depended upon 
actually comes from.

> If the porter listed A as the dependency and libfoo is already
> installed via B, what is the mechanism in the ports infrastructure by
> which B gets registered as the dependency?

The package database keeps track of all files installed by ports and knows 
which port installed which file.  See "man pkg_which".


More information about the freebsd-ports mailing list