Port dependency tool (if that's what you'd call it)

Mark Evenson mark.evenson at gmx.at
Mon Apr 30 07:41:00 UTC 2007


Modulok wrote:
> I'm not quite sure how to put into word what I want, so bear with me. Is
> there a tool in the base system which does something along these lines:
> 
> 1. Look at the makefile of a given port as far as its RUN_DEPENDS and
> BUILD_DEPENDS.
> 2. Subtracting what I have already installed, provide me with information
> about what would be fetched (and possibly installed) in an easy-to-digest
> format, recursively (for all dependents of dependents ... and so on).
> 
> If not part of the base system, is there a port which offers this
> functionality?

The standard ports for this kind of functionality are

	port-mgmt/portupgrade
	port-mgmt/portmaster

'portupgrade' is the older utility; 'portmaster' has recently come on 
the "scene", with slightly different aims.  I use 'portupgrade' as I 
haven't really spent the time to learn about 'portmaster'.

Once 'portupgrade' is installed, and you have built its database with 
'pkgdb', you should be able to answer your second question via

	freebsd$ portupgrade --noexecute --upward-recursive PORTNAME

where PORTNAME is the name of the port (qv. 'ports_glob' for how this is 
specified) to give you information on what needs to be updated.  You 
might need to trim the output a bit to get the succinct list of 
dependencies that need updating, but the output of 'portupgrade' is 
quite regular so a little regexp'in in your preferred scripting language 
  should bring you to the result you want.

There may be other more direct routes to the information you seek, but 
this way will definitely work.




-- 
<Mark.Evenson at gmx.at>

"[T]his is not a disentanglement from, but a progressive knotting into."



More information about the freebsd-questions mailing list