Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Sep 2011 13:42:46 +1000
From:      Lawrence Stewart <lstewart@freebsd.org>
To:        chukharev@mail.ru
Cc:        "freebsd-ports@freebsd.org" <freebsd-ports@freebsd.org>
Subject:   Re: Detecting dependencies
Message-ID:  <4E741736.70207@freebsd.org>
In-Reply-To: <op.v1tgwdtmmhpy7y@localhost>
References:  <op.v1tgwdtmmhpy7y@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/15/11 07:06, chukharev@mail.ru wrote:
> Hi,
>
> There have been a discussion about finding interdependencies of ports.
> I have a relatively simple Python script for that. There is a pr
> ports/160007
> to add its early version. Unfortunately, I missed a reply to it, so
> there is
> an issue which I have not yet addressed...
>
> Since that time, I added reverse dependencies with full ports tree scanning
> (1 h on my 2.5GHz notebook) and saving the tree (directed graph, actually)
> to a file, so that rescanning all ports tree is not needed.
>
> See http://code.google.com/p/porttree/
>
> If there will be interest, scanning packages interdependencies could
> also be added.
>

On a related subtopic, we also need a tool that identifies implicit 
dependencies not captured in the ports Makefiles. I hacked the following 
together earlier this year to smooth over the updating process when key 
libraries get bumped (e.g. the gettext update at the time I wrote the 
script was a nightmare). There were a tonne of ports which needed to be 
updated even though they didn't explicitly record a dependency on gettext.

https://lauren.room52.net/hg/scripts/raw-file/tip/libdepend/libdepend.sh

It's still quite rough and manually driven and is tied to portmaster at 
the moment, but I use it routinely after a "portmaster -ad" to check 
that no libs are missing dependencies. It works pretty well most of the 
time, but definitely needs more finessing. I share it mostly to prove 
the feasibility of the approach and in case anyone is curious.

I haven't thought the following ideas through a great deal and welcome 
feedback, but I think the basic functionality/premise of this script 
could be integrated into the ports framework so that at package 
registration time, implicit deps are identified and marked in the 
package database. A warning could also be generated that the port is 
using deps not identified in the Makefile, and perhaps trigger a send-pr 
to the port maintainer to let them know.

That way when we update ports using a tool like portmaster, it will know 
to update all the relevant ports and avoid leaving your system broken 
(yes, I'm aware of the -w switch, but I prefer not to use it as you can 
get into nasty situations if the compat and non-compat libs get mixed at 
run-time).

A script like this could also be integrated/called somehow from a tool 
like portmaster during an update to ensure ports with implicit 
dependencies on another port which has been updated are identified and 
recompiled too so that we avoid the nasty problems that crop up with 
missing library dependencies.

Cheers,
Lawrence



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