Index: branches/locker-dev/locker/sbin/commit-email.pl
===================================================================
--- branches/locker-dev/locker/sbin/commit-email.pl	(revision 1221)
+++ branches/locker-dev/locker/sbin/commit-email.pl	(revision 1414)
@@ -1,3 +1,11 @@
 #!/usr/bin/env perl
+
+# ====================================================================
+# This script is deprecated.  The Subversion developers recommend
+# using mailer.py for post-commit and post-revprop change
+# notifications.  If you wish to improve or add features to a
+# post-commit notification script, please do that work on mailer.py.
+# See http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/mailer .
+# ====================================================================
 
 # ====================================================================
@@ -10,8 +18,8 @@
 # This script requires Subversion 1.2.0 or later.
 #
-# $HeadURL: http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in $
-# $LastChangedDate: 2008-04-01 13:19:34 -0400 (Tue, 01 Apr 2008) $
-# $LastChangedBy: glasser $
-# $LastChangedRevision: 30158 $
+# $HeadURL: http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/commit-email.pl.in $
+# $LastChangedDate: 2009-05-12 13:25:35 -0400 (Tue, 12 May 2009) $
+# $LastChangedBy: blair $
+# $LastChangedRevision: 37715 $
 #
 # ====================================================================
@@ -44,4 +52,6 @@
 ######################################################################
 # Configuration section.
+
+$ENV{'LC_ALL'} = 'en_US.UTF-8';
 
 # Sendmail path, or SMTP server address.
@@ -558,5 +568,5 @@
     my @head;
     my $formatted_date;
-    if (defined $stdout)
+    if ($stdout)
       {
         $formatted_date = strftime('%a %b %e %X %Y', localtime());
@@ -753,5 +763,5 @@
     }
 
-  my $openfork_available = $^O ne "MSWin32"; 
+  my $openfork_available = $^O ne "MSWin32";
   if ($openfork_available) # We can fork on this system.
     {
@@ -769,9 +779,9 @@
         }
     }
-  else  # Running on Windows.  No fork. 
+  else  # Running on Windows.  No fork.
     {
       my @commandline = ();
       my $arg;
-      
+
       while ($arg = shift)
         {
@@ -780,5 +790,5 @@
           push(@commandline, $arg);
         }
-        
+
       # Now do the pipe.
       open(SAFE_READ, "@commandline |")
Index: branches/locker-dev/locker/sbin/commit-zephyr
===================================================================
--- branches/locker-dev/locker/sbin/commit-zephyr	(revision 1221)
+++ branches/locker-dev/locker/sbin/commit-zephyr	(revision 1414)
@@ -1,5 +1,16 @@
-#!/bin/sh
+#!/bin/bash
+#
+# This is a script that can be called from a Subversion post-commit hook
+# to zephyr a summary of the commit or the full commit.
+#
+# Use by putting something like the following in hooks/post-commit:
+# REPOS="$1"
+# REV="$2"
+# /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" -c scripts
+# /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" --full -c scripts-auto -i commits
 
-CLASS=scripts
+export LC_ALL=en_US.UTF-8
+
+CLASS=test
 INSTANCE=@
 FULL=0
@@ -39,3 +50,3 @@
 	echo svnlook diff "$REPOS" -r "$REV"
     fi
-) | zwrite -d -c "$CLASS" -i "$INSTANCE" -s "r$REV - $dirs"
+) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV"
Index: branches/locker-dev/locker/sbin/parallel-find.pl
===================================================================
--- branches/locker-dev/locker/sbin/parallel-find.pl	(revision 1221)
+++ branches/locker-dev/locker/sbin/parallel-find.pl	(revision 1414)
@@ -2,4 +2,7 @@
 
 # Script to help generate find the .scripts-version files
+
+use LockFile::Simple qw(trylock unlock);
+use File::stat;
 
 use lib '/mit/scripts/sec-tools/perl';
@@ -7,7 +10,24 @@
 open(FILE, "</mit/scripts/sec-tools/store/scriptslist");
 my $dump = "/mit/scripts/sec-tools/store/versions";
+my $dumpbackup = "/mit/scripts/sec-tools/store/versions-backup";
 
-(! -e $dump) || die "Output directory exists: $dump";
-system("mkdir", $dump) && die;
+# try to grab a lock on the version directory
+trylock($dump) || die "Can't acquire lock; lockfile already exists at <$dump.lock>.  Another parallel-find may be running.  If you are SURE there is not, remove the lock file and retry.";
+
+sub unlock_and_die ($) {
+    my $msg = shift;
+    unlock($dump);
+    die $msg;
+}
+
+# if the versions directory exists, move it to versions-backup
+# (removing the backup directory if necessary).  Then make a new copy.
+if (-e $dump){
+    if (-e $dumpbackup){
+        system("rm -rf $dumpbackup") && unlock_and_die "Can't remove old backup directory $dumpbackup";
+    }
+    system("mv", $dump, $dumpbackup) && unlock_and_die "Unable to back up current directory $dump";
+}
+system("mkdir", $dump) && unlock_and_die "mkdir failed to create $dump";
 
 use Proc::Queue size => 40, debug => 0, trace => 0;
@@ -28,8 +48,20 @@
 }
 
+sub old_version ($) {
+    my $dirname = shift;
+    open my $h, "$dirname/.scripts-version";
+    chomp (my $v = (<$h>)[-1]);
+    return $v;
+}
+
 sub version ($) {
     my $dirname = shift;
-    open my $h, "$dirname/.scripts-version";
-    return (<$h>)[-1];
+    $uid = stat($dirname)->uid;
+    open my $h, "sudo -u#$uid git --git-dir=$dirname/.git describe --tags --always 2>/dev/null |";
+    chomp($val = <$h>);
+    if (! $val) {
+        print "Failed to read value for $dirname\n"
+    }
+    return $val;
 }
 
@@ -38,15 +70,23 @@
     my $homedir = shift;
 
-    open my $files, "find $homedir/web_scripts -xdev -name .scripts-version 2>/dev/null |";
+    open my $files, "find $homedir/web_scripts -xdev -name .scripts-version -o -name .scripts 2>/dev/null |";
     open my $out, ">$dump/$user";
     while (my $f = <$files>) {
         chomp $f;
-        $f =~ s!/\.scripts-version$!!;
+        my $new_style;
+        $new_style = ($f =~ s!/\.scripts$!!);
+        if (! $new_style) {
+            $f =~ s!/\.scripts-version$!!;
+            # Don't use .scripts-version of .scripts is around!
+            if (-d "$f/.scripts") {
+                next;
+            }
+        }
         if (! updatable($f)) {
             print STDERR "not updatable: $f";
             next;
         }
-        $v = version($f);
-        print $out "$f:$v";
+        $v = $new_style ? version($f) : old_version($f);
+        print $out "$f:$v\n";
     }
     return 0;
@@ -57,13 +97,16 @@
     my $f=fork;
     if(defined ($f) and $f==0) {
-        if ($homedir !~ m|^/afs/athena|) {
-            print "ignoring non-athena-cell $user $homedir\n";
+        if ($homedir !~ m|^/afs/athena| && $homedir !~ m|^/afs/sipb| && $homedir !~ m|^/afs/zone|) {
+            print "ignoring foreign-cell $user $homedir\n";
             exit(0);
         }
-	print "$user\n";
+        print "$user\n";
         $ret = find($user, $homedir);
-	sleep rand 1;
-	exit($ret);
+        sleep rand 1;
+        exit($ret);
     }
     1 while waitpid(-1, WNOHANG)>0; # avoids memory leaks in Proc::Queue
 }
+
+unlock($dump);
+1;
