[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

customizing svnserve for svn+ssh

From: Matthew Beals <mjbeals_at_mtu.edu>
Date: Fri, 9 Sep 2011 21:13:01 -0400 (EDT)

I have two sets of repos setup... common repos and user repos. On the machine acting as the svn host, I have the common repos stored in /repos while the user repos are in /home/<username>/.repos/

I'm attempting to simplify svn+ssh access such that:

svn+ssh://<server>/Code/some_project_repo serves up /repos/Code/some_project_repo
svn+ssh://<server>/<username>/some_project_repo serves up /home/<username>/.repos/some_project_repo

I took the example of writing a shell script in /usr/local/bin that sets the umask and calls svnserve and modified it to include this path tinkering. Here is that script:

##############################################
#!/bin/bash

umask 002

PATH="$@"
ROOT="/repos"
USER=`echo $PATH | /bin/sed "s/^\/\([a-z]*\)\/.*/\1/"`
PATTERN="^$USER:"

if `/usr/bin/ypcat passwd | /bin/egrep -q $PATTERN` ; then
  ROOT="/home/$USER/.repos"
  PATTERN="s/\/$USER//"
  PATH=`echo $PATH | /bin/sed $PATTERN`
fi

exec /usr/bin/svnserve "$PATH" -r "$ROOT"
#################################################################

It just compares the first directory passed in against the users in the NIS domain and if it finds a match, builds a new Path and root path to the repos. It works just fine on the command line when I pass it paths and echo back out the parts, but when I attempt to actually run it (by accessing a repo with svn+ssh), $PATH does not get set to the path being passed in... it is just set to '-t'. However, when I try to access a common repo (where PATH is left unadulterated), it serves up the repo just fine. Is the path being passed encoded somehow? Is there are way to access it?

thanks,
Matt

----------------------------------------
Matthew Beals
Michigan Technological University
Department of Atmospheric Sciences
1400 Townsend Drive
B019a Fisher Hall
Houghton, MI 49931
mjbeals_at_mtu.edu
Received on 2011-09-10 03:13:37 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.