[rancid] Re: Setting up rancid with a corp svn server?

john heasley heas at shrubbery.net
Thu Dec 4 19:22:30 UTC 2008


Thu, Dec 04, 2008 at 07:42:46AM +0100, Karsten Heymann:
> Hi,
> 
> "Peter Serwe" <peter.serwe at gmail.com> writes:
> > So, if it were to be a pretty clean hack, i.e.: Something that could
> > be committed to the source tree
> 
> I solved this problem with the following trivial patch to
> rancid-cvs.in (in debian dpatch format, but should be usable by others
> too). Feel free to include it into the source tree. The idea is to
> test if CVSROOT contains the characters ://, and, depending on that,
> behave differently.
> 
> hth,
> Karsten

Nice, thats the idea.  It'd be less confusing to deal with CVSROOT always
being a URL, while also accepting a normal path.

> #! /bin/sh /usr/share/dpatch/dpatch-run
> ## 07_svn_remote.dpatch by  <karsten.heymann at gmx.de>
> ##
> ## All lines beginning with `## DP:' are a description of the patch.
> ## DP: Add support for remote subversion repositories
> 
> @DPATCH@
> diff -urNad rancid-2.3.2~a8~/bin/rancid-cvs.in rancid-2.3.2~a8/bin/rancid-cvs.in
> --- rancid-2.3.2~a8~/bin/rancid-cvs.in  2008-02-08 07:28:29.000000000 +0100
> +++ rancid-2.3.2~a8/bin/rancid-cvs.in   2008-09-26 08:51:18.000000000 +0200
> @@ -97,7 +97,9 @@
>      if [ $RCSSYS = cvs ]; then
>         cvs -d $CVSROOT init
>      else
> -       svnadmin create $CVSROOT @SVN_FSTYPE@
> +       if [[ $(expr match $CVSROOT '.*://') -eq 0 ]]; then
> +           svnadmin create $CVSROOT @SVN_FSTYPE@
> +       fi
>      fi
>  fi
> 
> @@ -127,10 +129,16 @@
>             cvs import -m "$GROUP" $GROUP new rancid
>             cd $BASEDIR
>             cvs checkout $GROUP
> -       else
> +
> +       # local subversion repository:
> +        elif [[ $(expr match $CVSROOT '.*://') -eq 0 ]]; then
>             svn import -m "$GROUP" . file://$CVSROOT/$GROUP
>             cd $BASEDIR
>             svn checkout file://$CVSROOT/$GROUP $GROUP
> +       else # remote subversion repository
> +           svn import -m "$GROUP" . $CVSROOT/$GROUP
> +           cd $BASEDIR
> +           svn checkout $CVSROOT/$GROUP $GROUP
>         fi
>      fi
>      cd $DIR
> 
> -- 
> Karsten Heymann
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


More information about the Rancid-discuss mailing list