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

Pre-commit svn wrapper check

From: David Coppit <subversion_at_coppit.org>
Date: 2005-02-06 05:34:20 CET

My systems staff doesn't want to change /usr/bin/svn, so I have put my
umask-svn wrapper in a different path. The problem is getting all my
developers to make sure that path is in their PATH. If they don't run the
wrapped version, the database will get corrupted.

Here's a pre-commit script that will double check that svn+ssh is getting
the svn wrapper.

   #!/usr/bin/perl

   use strict;

   my $repository_machine = 'ENTER YOUR REPOSITORY MACHINE HERE';
   my $wrapped_svn_path = 'ENTER THE PATH TO YOUR SVN WRAPPER HERE';

   my $user = `whoami`;
   chomp $user;

   my $svn = `ssh $user\@$repository_machine which svn`;
   chomp $svn;

   if ($svn ne "$wrapped_svn_path/svn")
   {
     die<<EOF;
   =============================================================================
   You are blocked from using the repository until you set your PATH environment
   so that $wrapped_svn_path appears first, so that you will run the wrapped
   version of svn instead of the system one.

   If we let you continue, you could corrupt the database! Here's the svn that
   you ran: "$svn"
   =============================================================================
   EOF
   }

   exit 0;

I hope that helps anyone else in the same boat as me.

David

_____________________________________________________________________
Dr. David Coppit Assistant Professor
coppit@cs.wm.edu Department of Computer Science
http://www.cs.wm.edu/~coppit/ The College of William and Mary

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Feb 6 05:36:44 2005

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.