One minute
portsnap
One of the most common tasks for a FreeBSD administrator is keeping the port collection up to date. Traditionally, one uses cvsup
as described in the Handbook. But Colin Percival, currently the security officer of the FreeBSD project, came up with an alternative solution: portsnap
The new sync tool addresses directly the drawbacks of cvsup
: it is “just” an add on to cvs
and therefore designed to check out those parts of the tree that have changed, assuming the developer in front of the machine knows where the changes are. It is quite slow in tracking down small changes in a huge tree (like the ports collection). Additionally, the transport of the data is not secured by any means, so the admin cannot check if the things he gets are those from the server or a third party. Changing from cvsup
to portsnap
is quite easy. Just disable the scripts calling cvsup
and portsnap fetch; portsnap extract; portsnap update
. After this first full extraction, one can add a simpe script just calling portsnap fetch; portsnap update
. Mind that in order to avoid peak loads, use porsnap cron
in cron
scripts. And don’t call porsnap update
automatically, it will undo any changes to the ports tree, work directories included!