[rancid] [PATCH] subversion with rancid 2.3.2a5

Vince Hoang vince at litrium.com
Sun Aug 20 06:19:57 UTC 2006

Here is a small patch against rancid 2.3.2a5 for subversion
related support to fix two problems when creating the initial
repository and importing new groups.

1) When checking out a repository, you have to specify a hostname
in the form of file://hostname/path. The patch basically assumes
a private svn repository on the local filesystem. In the long
run, it would better to have CVSROOT support URIs, but the
directory checks against CVSROOT would need to be removed or
worked around.

The original error before the patch was:

svn: Unable to open an ra_local session to URL
svn: Local URL 'file://home/rancid/var/svn' contains unsupported hostname

2) When importing a new group, the directory is out of sync after
the initial checkout. From the command-line, running `svn status`
will still report uncommitted changes and `svn commit` will
report the 'Out of date' error that you see in the logs.

The original error before the patch was:

svn: Commit failed (details follow):
svn: Out of date: '/routers' in transaction 'x'


diff -ur rancid-2.3.2a5/bin/control_rancid.in rancid-2.3.2a5-patched/bin/control_rancid.in
--- rancid-2.3.2a5/bin/control_rancid.in        2006-05-28 06:38:50.000000000 -1000
+++ rancid-2.3.2a5-patched/bin/control_rancid.in        2006-08-19 19:39:49.000000000 -1000
@@ -139,6 +139,12 @@

+# svn update to avoid 'Out of date' error
+if [ $RCSSYS = svn ]
+    svn update
 # do cvs update of router.db in case anyone has fiddled.
 $RCSSYS update router.db > $TMP 2>&1
 grep "^C" $TMP > /dev/null
diff -ur rancid-2.3.2a5/bin/rancid-cvs.in rancid-2.3.2a5-patched/bin/rancid-cvs.in
--- rancid-2.3.2a5/bin/rancid-cvs.in    2006-05-28 06:38:52.000000000 -1000
+++ rancid-2.3.2a5-patched/bin/rancid-cvs.in    2006-08-19 19:37:06.000000000 -1000
@@ -81,9 +81,11 @@
            cd $BASEDIR
            cvs checkout $GROUP
-           svn import -m "$GROUP" . file://$CVSROOT/$GROUP
+           svn import -m "$GROUP" . file://localhost/$CVSROOT/$GROUP
            cd $BASEDIR
-           svn checkout file://$CVSROOT/$GROUP $GROUP
+           svn checkout file://localhost/$CVSROOT/$GROUP $GROUP
+           cd $DIR
+           svn update
     cd $DIR

More information about the Rancid-discuss mailing list