View Full Version : Simple Path Specification Question - re: Subversion
Jun 20, 2006, 03:29 PM
I don't speak Unix, but I managed to install subversion via darwinports, and intend to put a repository on a network disk connected with an NSLU2 Network Storage Link via Samba. I see I've got to access subversion commands via terminal using an /opt/local/bin/ path specification, which is, I'm learning, the bin folder within the local folder within the opt folder at the top level of my hard disk, to use old Mac terminology.
So if my remote disk is called "Rmt" for example, how to I specify that the repository be created there?
(I find it is possible to install an svnserve in an NSLU2, but that is probably beyond me at the moment. The instructions assume much familiarity with Unix.)
Jun 20, 2006, 07:41 PM
I'm not entirely certain, but I'm thinking it will go something like this (assuming you've mounted "Rmt")
/opt/local/bin/svnadmin create --fs-type fsfs /Volumes/Rmt
You have to create a respository before you can add projects into it, and the standard Berkley DB that Subversion uses (though I believe subversion now supports fsfs by default) is not usable over a network drive.
So, if subversion uses fsfs by default you'd likely simply have to do
/opt/local/bin/svnadmin create /Volumes/Rmt
More info can be found here:
By default, Mac OS X will mount any volumes (whether they be network or local) in the /Volumes directory. That is where you should look, unless you specified another directory to mount your Rmt volume to. I don't know if that's what you were looking for or not, and as a bit of an aside, my install of subversion was installed to /usr/local/bin.
Also, if you don't want to precede the command name with the path you can either cd into that directory or append it to your $PATH variable.
EDIT: Snarly snafus.
Jun 20, 2006, 11:53 PM
Thanks for the information. The /Volumes/ path seems to be what I need to know. I'm concerned about a statement in your reference that "Both svnadmin and svnlook are considered server-side utilities—they are used on the machine where the repository resides to examine or modify aspects of the repository, and are in fact unable to perform tasks across a network." This suggests that /Volumes/ might not do the trick, but I'll do some experimenting to see what I come up with.
Jun 21, 2006, 12:50 AM
No luck. It partially writes to the remote volume then fails. The default is now fsfs, so this is not due to a problem with the Berkeley DB.
svnadmin: Can't write to file '/Volumes/Rmt/svnrep2/db/write-lock': Input/output error
I apparently have to look into what it takes to cross compile svnserve from Xcode on a PPC Mac into the ARM processor on an NSLU2. I see that darwinports can import arm-elf (or is it elf-arm) for the latest gcc compiler, but I may find myself clueless after that.
Jun 27, 2006, 07:44 PM
FWIW, I was sucessful in doing a subversion import and checkout from the Mac to a network disk attached to an NSLU2, without having to compile anything. Just had to learn a little Unix and study the available documentation from various sources. I found no need to install SSH on a home network. Initial tests were done with svnserve running in daemon mode on the NSLU2. I may configure svnserve as an inetd service on the NSLU2, but not necessary if I rarely shut it off. Needed to run "export EDITOR=vi" in the Terminal, not in Telnet to the NSLU2, in order for import to work. Needed to set up the svnserve.conf and passwd files in the svn repository on the NSLU2 using the vi editor from Terminal & Telnet. I set up the repository according to Apple document "Getting Control with Subversion and XCode" by adding folders for trunk, branches and tags. It is unclear how to back up the repository to a CD, as it appears when looking at the files on the disk that the imported information is not in the repository, even though checkout works. I've not yet done tests with XCode.
Jun 30, 2006, 06:30 PM
In case anyone googles into this thread, I should add a few more notes.
Backup should be simple with the dump and load commands noted in the Subversion documentation.
Setting up the inetd service for svnserve on an NSLU2 was not well documented in the available sources. Two files need to be edited: /etc/services and /etc/inetd.conf. Presently the NSLU2 Unslung Svn docs don't note the first edit, and the Subversion manual doesn't have the right form for the NSLU2. (Don't say "/svnserve svnserve -i" in inetd.conf on an NSLU2).
In my version of the change to inetd.conf, I restrict svnserve operation to a directory on the NSLU2 called SvnReps.
After it is setup it works fine with XCode in all my tests so far.
Add these two lines to /etc/services
(first and last lines noted here are already present)
# service-name port/protocol [aliases ...] [# comment]
svn 3690/tcp # Subversion
svn 3690/udp # Subversion
tcpmux 1/tcp # TCP port service multiplexer
Add this line to /etc/inetd.conf
(last line noted here is already present)
svn stream tcp nowait root /opt/bin/svnserve -i -r /SvnReps
telnet stream tcp nowait root /usr/sbin/telnetd
FWIW, this is what I use for import / checkout commands. The repository TestRep was created in the /SvnReps directory initially via Telnet to svnadmin on the NSLU2. I don't use SSH, as I use this on a one user local network.
/opt/local/bin/svn import -m 'Initial Gamma Import' /Users/programming/Desktop/MyBox2/Gamma svn://192.168.1.77/TestRep/Gamma
/opt/local/bin/svn checkout svn://192.168.1.77/TestRep/Gamma /Users/programming/Desktop/MyBox3/Gamma