Ignore:
Timestamp:
Jan 12, 2010, 11:55:27 PM (14 years ago)
Author:
ezyang
Message:
Merged in changes from trunk

--- Merging r1262 through r1413 into 'deploy/bin':
U    deploy/bin/django
   C deploy/bin/rails
   > Resolved by accepting working copy
--- Merging r1221 through r1413 into '.':
U    sql/bin/get-password
U    sql/bin/save-password
U    doc/tickets/rt.txt
U    doc/tickets/cnames.txt
U    bin/fix-php-ini
   C bin/scripts-rails
   > Resolved by accepting working copy
Skipped 'bin/for-each-server'
 U   bin
U    sbin/parallel-find.pl
U    sbin/commit-email.pl
U    sbin/commit-zephyr
Summary of conflicts:
  Tree conflicts: 2
  Skipped paths: 1

Location:
branches/locker-dev/locker
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/locker-dev/locker

  • branches/locker-dev/locker/sbin/commit-email.pl

    r719 r1414  
    11#!/usr/bin/env perl
     2
     3# ====================================================================
     4# This script is deprecated.  The Subversion developers recommend
     5# using mailer.py for post-commit and post-revprop change
     6# notifications.  If you wish to improve or add features to a
     7# post-commit notification script, please do that work on mailer.py.
     8# See http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/mailer .
     9# ====================================================================
    210
    311# ====================================================================
     
    1018# This script requires Subversion 1.2.0 or later.
    1119#
    12 # $HeadURL: http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in $
    13 # $LastChangedDate: 2008-04-01 13:19:34 -0400 (Tue, 01 Apr 2008) $
    14 # $LastChangedBy: glasser $
    15 # $LastChangedRevision: 30158 $
     20# $HeadURL: http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/commit-email.pl.in $
     21# $LastChangedDate: 2009-05-12 13:25:35 -0400 (Tue, 12 May 2009) $
     22# $LastChangedBy: blair $
     23# $LastChangedRevision: 37715 $
    1624#
    1725# ====================================================================
     
    4452######################################################################
    4553# Configuration section.
     54
     55$ENV{'LC_ALL'} = 'en_US.UTF-8';
    4656
    4757# Sendmail path, or SMTP server address.
     
    558568    my @head;
    559569    my $formatted_date;
    560     if (defined $stdout)
     570    if ($stdout)
    561571      {
    562572        $formatted_date = strftime('%a %b %e %X %Y', localtime());
     
    753763    }
    754764
    755   my $openfork_available = $^O ne "MSWin32"; 
     765  my $openfork_available = $^O ne "MSWin32";
    756766  if ($openfork_available) # We can fork on this system.
    757767    {
     
    769779        }
    770780    }
    771   else  # Running on Windows.  No fork. 
     781  else  # Running on Windows.  No fork.
    772782    {
    773783      my @commandline = ();
    774784      my $arg;
    775      
     785
    776786      while ($arg = shift)
    777787        {
     
    780790          push(@commandline, $arg);
    781791        }
    782        
     792
    783793      # Now do the pipe.
    784794      open(SAFE_READ, "@commandline |")
  • branches/locker-dev/locker/sbin/commit-zephyr

    r748 r1414  
    1 #!/bin/sh
     1#!/bin/bash
     2#
     3# This is a script that can be called from a Subversion post-commit hook
     4# to zephyr a summary of the commit or the full commit.
     5#
     6# Use by putting something like the following in hooks/post-commit:
     7# REPOS="$1"
     8# REV="$2"
     9# /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" -c scripts
     10# /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" --full -c scripts-auto -i commits
    211
    3 CLASS=scripts
     12export LC_ALL=en_US.UTF-8
     13
     14CLASS=test
    415INSTANCE=@
    516FULL=0
     
    3950        echo svnlook diff "$REPOS" -r "$REV"
    4051    fi
    41 ) | zwrite -d -c "$CLASS" -i "$INSTANCE" -s "r$REV - $dirs"
     52) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV"
  • branches/locker-dev/locker/sbin/parallel-find.pl

    r730 r1414  
    22
    33# Script to help generate find the .scripts-version files
     4
     5use LockFile::Simple qw(trylock unlock);
     6use File::stat;
    47
    58use lib '/mit/scripts/sec-tools/perl';
     
    710open(FILE, "</mit/scripts/sec-tools/store/scriptslist");
    811my $dump = "/mit/scripts/sec-tools/store/versions";
     12my $dumpbackup = "/mit/scripts/sec-tools/store/versions-backup";
    913
    10 (! -e $dump) || die "Output directory exists: $dump";
    11 system("mkdir", $dump) && die;
     14# try to grab a lock on the version directory
     15trylock($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.";
     16
     17sub unlock_and_die ($) {
     18    my $msg = shift;
     19    unlock($dump);
     20    die $msg;
     21}
     22
     23# if the versions directory exists, move it to versions-backup
     24# (removing the backup directory if necessary).  Then make a new copy.
     25if (-e $dump){
     26    if (-e $dumpbackup){
     27        system("rm -rf $dumpbackup") && unlock_and_die "Can't remove old backup directory $dumpbackup";
     28    }
     29    system("mv", $dump, $dumpbackup) && unlock_and_die "Unable to back up current directory $dump";
     30}
     31system("mkdir", $dump) && unlock_and_die "mkdir failed to create $dump";
    1232
    1333use Proc::Queue size => 40, debug => 0, trace => 0;
     
    2848}
    2949
     50sub old_version ($) {
     51    my $dirname = shift;
     52    open my $h, "$dirname/.scripts-version";
     53    chomp (my $v = (<$h>)[-1]);
     54    return $v;
     55}
     56
    3057sub version ($) {
    3158    my $dirname = shift;
    32     open my $h, "$dirname/.scripts-version";
    33     return (<$h>)[-1];
     59    $uid = stat($dirname)->uid;
     60    open my $h, "sudo -u#$uid git --git-dir=$dirname/.git describe --tags --always 2>/dev/null |";
     61    chomp($val = <$h>);
     62    if (! $val) {
     63        print "Failed to read value for $dirname\n"
     64    }
     65    return $val;
    3466}
    3567
     
    3870    my $homedir = shift;
    3971
    40     open my $files, "find $homedir/web_scripts -xdev -name .scripts-version 2>/dev/null |";
     72    open my $files, "find $homedir/web_scripts -xdev -name .scripts-version -o -name .scripts 2>/dev/null |";
    4173    open my $out, ">$dump/$user";
    4274    while (my $f = <$files>) {
    4375        chomp $f;
    44         $f =~ s!/\.scripts-version$!!;
     76        my $new_style;
     77        $new_style = ($f =~ s!/\.scripts$!!);
     78        if (! $new_style) {
     79            $f =~ s!/\.scripts-version$!!;
     80            # Don't use .scripts-version of .scripts is around!
     81            if (-d "$f/.scripts") {
     82                next;
     83            }
     84        }
    4585        if (! updatable($f)) {
    4686            print STDERR "not updatable: $f";
    4787            next;
    4888        }
    49         $v = version($f);
    50         print $out "$f:$v";
     89        $v = $new_style ? version($f) : old_version($f);
     90        print $out "$f:$v\n";
    5191    }
    5292    return 0;
     
    5797    my $f=fork;
    5898    if(defined ($f) and $f==0) {
    59         if ($homedir !~ m|^/afs/athena|) {
    60             print "ignoring non-athena-cell $user $homedir\n";
     99        if ($homedir !~ m|^/afs/athena| && $homedir !~ m|^/afs/sipb| && $homedir !~ m|^/afs/zone|) {
     100            print "ignoring foreign-cell $user $homedir\n";
    61101            exit(0);
    62102        }
    63         print "$user\n";
     103        print "$user\n";
    64104        $ret = find($user, $homedir);
    65         sleep rand 1;
    66         exit($ret);
     105        sleep rand 1;
     106        exit($ret);
    67107    }
    68108    1 while waitpid(-1, WNOHANG)>0; # avoids memory leaks in Proc::Queue
    69109}
     110
     111unlock($dump);
     1121;
Note: See TracChangeset for help on using the changeset viewer.