Link Search Menu Expand Document

Update FreeBSD source tree using subversion svn

In a previous post I described the process for updating the FreeBSD source tree using csup and upgrading from FreeBSD release to the stable branch. These days subversion svn has started to replace cvs as the version control system for the FreeBSD source tree. Here I am going to note the commands you would use to updating the FreeBSD source tree using subversion instead of csup.

First you will need subversion installed on the system, to do this you can install from the ports or packages.

From ports:

# cd /usr/ports/devel/subversion
# make install

From package:

# pkg_add -r subversion

You can just accept the default port configuration options. Once installed you can then update the FreeBSD source tree using this command, this will update the source tree to FreeBSD 9-STABLE, the same as the RELENG_9 tag used in csup.

# svn co svn:// /usr/src

Other examples, to update to the latest HEAD.

# svn co svn:// /usr/src

Or even get the source for an old release.

# svn co svn:// /usr/src

To find paths to other repositories you can checkout see the FreeBSD viewvc pages, here

Once the source tree is checked out with subversion the path and options used from the check out is stored in the new /usr/src/.svn directory. Thanks to this all it takes to update the FreeBSD source tree in the future is this command.

# svn up /usr/src

This will update the source to the latest revision and, of course, only copy the files that are new or have changed. If you need to find out the revision of the source you currently have you can use this command, (there are other ways to get the revision number also).

# svn info /usr/src
Path: .
Working Copy Root Path: /usr/src
URL: svn://
Repository Root: svn://
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 228954
Node Kind: directory
Schedule: normal
Last Changed Author: cperciva
Last Changed Rev: 228843
Last Changed Date: 2011-12-23 15:00:37 +0000 (Fri, 23 Dec 2011)