Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2006 14:32:11 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        pav@freebsd.org, freebsd ports <freebsd-ports@freebsd.org>
Subject:   Re: New /bin/sh based script to manage ports
Message-ID:  <43C97BEB.3030601@FreeBSD.org>
In-Reply-To: <20060114144016.1dc9fdd0@Magellan.Leidinger.net>
References:  <43BCF31F.8050900@FreeBSD.org>	<1136501778.40648.17.camel@localhost>	<43C38A38.1020408@FreeBSD.org>	<1136893017.2410.9.camel@pav.hide.vol.cz>	<43C8E446.5010603@FreeBSD.org> <20060114144016.1dc9fdd0@Magellan.Leidinger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Alexander Leidinger wrote:
> On Sat, 14 Jan 2006 03:45:10 -0800 Doug Barton <dougb@freebsd.org> wrote:
> 
>> This is done too now, although it turned out to be a lot harder than I
>>  expected. It required redoing how some of the internal stuff worked,
>> but in the end it made the whole script better, so I'm glad I pursued
>> this. As an extra bonus you can now do 'portmaster -af' and it will
>> force an update of all ports on your system, starting with the leaves.
> 
> "Leafes" as in "those ports which no other ports depends upon"?

Yes.

> If yes: are you sure this is a good idea? Wouldn't you think a better
> approach would be to start with those ports, which depend upon no other
> port (= "root" ports in my terminology)?

Yes, except that I left out one important part of that explanation. :)

What portmaster does when asked to update a given port is (leaving out some 
steps):

1. cd to the port directory
2. make config
3. Get a list of dependencies by doing 'make all-depends-list'
4. Recursively check to see if each of those dependencies is up to date, and 
update it if not by launching a child process of itself
5. Return to the original port, and update it

So, in the non-forced update case, any dependencies of a leaf port will get 
updated before the leaf does. Anything that is already up to date won't get 
touched. In the forced update case, we'll recurse through the dependency 
list of the first leaf port all the way down to the root ports, then back up 
through each dependency, and finally back up to the leaf. In the force case, 
I keep a list of ports that have been updated so that we only have to do 
that once for each port.

Now theoretically there is nothing wrong with your suggestion, and other 
than the fact that I wanted to keep the same process in place for updating 
all the ports as I do for updating them one at a time, I could have done it 
that way. In fact, the more I think about it the more I think it makes sense 
to do it in this order for the 'update all' case:

1. ports that have no dependencies (roots)
2. ports that have dependencies, and are depended on (branches?)
3. ports that have dependencies, and are not depended on (leaves)

I'll do some testing on this and let you know, thanks for this suggestion.

Doug

-- 

     This .signature sanitized for your protection




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