diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-07-05 05:07:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2006-07-05 05:07:00 +0000 |
commit | 49cd23b8d7ea17b0cf43b7c02e444fb10b56590d (patch) | |
tree | 23b073dff3b3e6ad286cc0b593ab167824cc949f /Carpet/CarpetWeb/scripts | |
parent | ab493f572a1364e7a9fe5e9b042b9ce391bfdd3f (diff) |
CarpetWeb: Update patchset-to-email gateway script
Apparently darcs now passes the repository as command line argument.
Don't get confused, and save the repository for later.
darcs-hash:20060705050726-dae7b-22d9e6a007c9b05d34d78f07eb77db6db790b692.gz
Diffstat (limited to 'Carpet/CarpetWeb/scripts')
-rwxr-xr-x | Carpet/CarpetWeb/scripts/darcs0 | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Carpet/CarpetWeb/scripts/darcs0 b/Carpet/CarpetWeb/scripts/darcs0 index d42566801..8ec50d35e 100755 --- a/Carpet/CarpetWeb/scripts/darcs0 +++ b/Carpet/CarpetWeb/scripts/darcs0 @@ -20,9 +20,20 @@ my %comments = (); # sanity check die "Couldn't find executable '$darcs'!\n\n" if (! -x $darcs); +open (LOG, ">> /home/darcs/LOG"); +print LOG "\n"; +print LOG "darcs called:\n"; +print LOG "date: ", `date`, "\n"; +print LOG "arguments: ", join (' ', @ARGV), "\n"; + # short cut for darcs commands other than 'apply --all' +$repodir = ''; exec ($darcs, @ARGV) - if (! ($#ARGV == 1 && $ARGV[0] eq 'apply' && $ARGV[1] eq '--all')); + if (! ($#ARGV == 1 && ($ARGV[0] eq 'apply' && $ARGV[1] eq '--all')) && + ! ($#ARGV == 3 && ($ARGV[0] eq 'apply' && $ARGV[1] eq '--all' && + $ARGV[2] eq '--repodir' && ($repodir = $ARGV[3])))); + +print LOG "calling darcs:\n"; # open a pipe for running darcs on the other end open (DARCS, "| $darcs @ARGV") || die "Couldn't open pipe to darcs !\n"; @@ -31,6 +42,7 @@ open (DARCS, "| $darcs @ARGV") || die "Couldn't open pipe to darcs !\n"; while (<STDIN>) { print DARCS; + print LOG; last if (/^New patches:$/); } @@ -41,6 +53,7 @@ my $endmarker = '] {'; while (<STDIN>) { print DARCS; + print LOG; # each patch starts with a line '[<patch name>' next if (! /^\[(.+)$/); @@ -50,6 +63,7 @@ while (<STDIN>) # and the timestamp of the patch $_ = <STDIN>; print DARCS; + print LOG; next if (! /^(.+)\*\*(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})($endmarker)??$/o); # add this patch to the database @@ -64,6 +78,7 @@ while (<STDIN>) while (<STDIN>) { print DARCS; + print LOG; last if (/^$endmarker$/); $comments{$patch} .= $_; } @@ -75,12 +90,17 @@ while (<STDIN>) while (<STDIN>) { print DARCS; + print LOG; last if (/^}$/); } } close (DARCS) || die "Failed to run darcs command '$darcs @ARGV'\n"; +print LOG "(that was the patch set)\n"; +print LOG "submitters: ", join (' ', %submitters), "\n"; +print LOG "done.\n"; + # now send out notification email(s) foreach $patch (keys %submitters) { @@ -92,8 +112,10 @@ foreach $patch (keys %submitters) open (NOTIFY, '|-') || exec 'mail', '-s', $patch, $email_list; #print NOTIFY "A new patch has been pushed into the Carpet repository:\n\n"; - $repodir = `pwd`; - chomp $repodir; + if ($repodir eq '') { + $repodir = `pwd`; + chomp $repodir; + } $repodir =~ s+^.*/home/+~+; print NOTIFY "The Carpet repository at $repodir received a new patch:\n\n"; print NOTIFY " $patch\n\n"; |