Proper way to update ports with svn

Michael Powell nightrecon at
Sun Mar 31 06:57:17 UTC 2013

Andre Goree wrote:

> On Fri, 29 Mar 2013 21:52:41 -0400, Damien Fleuriot <ml at> wrote:
>> On 29 March 2013 22:29, Andre Goree <andre at> wrote:
>>> I seem to have to run 'make index' in /usr/ports after I've run 'svn up
>>> /usr/ports' in order to see which ports need to be updated using
>>> 'portversion'.  This doesn't seem correct...and if so portsnap would
>>> seem like a much better tool.  Perhaps I should be running 'make
>>> fetchindex' instead?  I'm sure I've read about the correct way to do so,
>>> but it doesn't appear to be here:
>>> Thanks in advance for any advice.
>> 'make index' looks good to me, it's the right way to do things imo.
>> What bothers you, following 'make index', pkg version output seems dodgy
>> ?
> Mainly, just the amount of time it takes to run "make index", lol.  And
> the fact that I never had to do so with portsnap.  I'm thinking that
> perhaps portsnap runs something similar to 'make fetchindex'  within the
> whole 'portsnap fetch update' process...?

In case you find this of interest, FWIW I changed from the old csup to using 
portsnap. I also still use portupgrade. This is the command I do to check 
for ports in need of update:

# portsnap fetch update && portsdb -u && pkgdb -F && portversion

The portsnap fetch update portion outputs "Building new INDEX files... 
done." at the end of its run. Notice the three subsequent commands are from 
the portupgrade package.

Portsnap will alter or change the INDEX-7, INDEX-8, and INDEX-9 files. As 
pointed out elsewhere portupgrade manages its own index database file 
separately and in parallel, which is the INDEX-9.db file.

At first glance it would seem that running portsdb and pkgdb might appear to 
be semi-superfluos, but doing so will check the package database and ensure 
it is exactly in sync with the ports INDEX-* files. I would rather pkgdb 
dump out an error if something is wrong, and it will if there is something 
not quite right in the package database. As long as everything is good it 
just sails on through and portversion tells me which ports are in need of 
upgrade. Then I read the new UPDATING file prior to doing portupgrade -a, 
following any instructions which may pertain.

I have been doing this for 3-4 months now and it has served me well. I was 
doing something very similar back in the csup days, but I had to work out 
some small changes to the above command line using trial and error. The 
above result is very fast, as compared to just trying to use the same old 
identical CLI switches from csup days.

To start from a clean slate I wiped /usr/ports and followed the Handbook 
commands of portsnap fetch followed by the portsnap extract commands. Once I 
had a new pristine ports tree I update it and check for new ports with the 
above command. It has worked well.


More information about the freebsd-questions mailing list