micmath blog
RecentRunning A Personal SVN Server on Mac Snow Leopard
I love version control. I use it more than is probably appropriate to be honest. For personal projects that don't warrent their own page on github or google projects I like to use a quick and simple svn repo right on my laptop. I have Apple's Time Machine running on there and full weekly snapshots saved to an external hard drive, so I'm not too concerned about the repo itself getting hosed.
I do however want it to be easy to make frequent commits to files I'm working on. And I specifically don't want to run svn with apache -- that is simply overkill for my personal usage. Finding decent instructions on how to set that up on Snow Leopard is difficult, so here's how I did it:
1. If you haven't already done so, download the installer for the excellent My Subversion-1.5.5 Package. It's simply a double click job and you then have an svn server and client all ready to go.
2. Create a folder to hold your repo. Adjust the filepaths to match your own system, obviously:
mkdir /Users/michael/svn
3. Start the svn server, pointing it at the repository directory you just created:
svnserve -d -r /Users/michael/svn
4. Create a new repository:
svnadmin create /Users/michael/svn/projects
5. Set up users for that new repository. This may be the most complicated step, but even this is very straight forward if you can edit an ini file:
bbedit /Users/michael/svn/projects/conf/svnserve.conf
It's just an ini type of file and has loads of useful comments (so read them). You'll want it to say this:
[general]
anon-access = read
auth-access = write
password-db = passwd
realm = projects
That means anonymous users can only read, while authenticated users can read and write. Also the password file is going to be in conf/passwd. So let's edit that now:
bbedit /Users/michael/svn/projects/conf/passwd
Again, a very simple ini type of file. Add yourself to it and save.
[users]
michael = secretpassword
6. Checkout your repository:
cd ~/Workarea
svn co svn://localhost/projects
7. Make changes, commit:
cd ~/Workarea/projects
bbedit README.txt
svn add README.txt
svn commit README.txt -m 'Initial commit.'
8. Finally, you can always stop the svn server, if you want to save a little battery juice:
killall svnserve
Mysterious At-Sign: Extended Attributes in Mac Files
I was attempting to run an old perl script today, and doing a quick ls -la to check the permissions revealed a mysterious at-sign @ in the permissions.
-rw-r--r--@ 1 michael michael 467 8 May 13:16 cvsToSql.pl
Hi there little at-sign. What are you doing in there?
And do you know how hard it is to google the meaning of an at-sign in ls -la? Not easy. I did learn that a filename with a trailing at-sign can indicate a symbolic link on Linux. But this is Mac OS X Leopard and the at-sign is in the permissions. More googling....
The best answer is from dev.netcetera.org and Jeff Seitz’s Blog, and it is that the at-sign indicates that the file has extended file attributes. Hmmm... I want to get rid of those I think. Step one is to find out the name of the extended attribute.
$ xattr -l cvsToSql.pl
com.apple.FinderInfo:
0000 54 45 58 54 52 2A 63 68 00 00 00 00 00 00 00 00 TEXTR*ch........
0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Okay, so my file has some extra data attached to the "com.apple.FinderInfo" attribute. I suppose there is some important nerd-reason for that being there but I'm not interested: step two is to get it off.
$ xattr -d com.apple.FinderInfo cvsToSql.pl
And no more at-sign! All that files attributes are now of the non-extended variety.
