DIVERTPOSTINGS=''
MODLOGSEARCH=true
MODLOGDOWNLOAD=true
+LOGREPORTOPTS=''
. settings
export GROUP ABBREV INFOHEADER MODEMAIL GROUPURL REJECTIONSLIST
-export DIVERTPOSTINGS MODLOGSEARCH MODLOGDOWNLOAD
+export DIVERTPOSTINGS MODLOGSEARCH MODLOGDOWNLOAD LOGREPORTOPTS
. ../global-settings
export ROOTBASEDIR CGIBASEURL DOMAIN SLIMYDOMAIN OURUSER ADMIN
"Subject: $Subject\n" .
"Organization: http://www.algebra.com/~ichudov/stump\n";
+ $message .= "\n# $cathow\n";
$message .= "\n$decision\n";
$message .= "comment $comment\n" if $comment;
&email_message( $message, $address );
my $publish_rejections_patfile= '/dev/null';
my $publish_rejections= 0;
-if ($ARGV[0] eq '-P') {
- $publish_rejections= 1;
- shift @ARGV;
-} elsif ($ARGV[0] =~ s/^\-P//) {
- $publish_rejections= 1;
- $publish_rejections_patfile= shift @ARGV;
+
+for (;;) {
+ last unless @ARGV;
+ last unless $ARGV[0] =~ m/^-/;
+ $_ = shift @ARGV;
+ last if m/^--?$/;
+ while (m/^-./) {
+ if (s/^-P(.*)$//) {
+ $publish_rejections= 1;
+ $publish_rejections_patfile= $1 if length $1;
+ } else {
+ die "bad option $_ ?";
+ }
+ }
}
our ($how) = @_;
parse__stumpsubject();
last if m/^$/;
}
+ my $cathow = '';
while (<STDIN>) {
chomp;
+ if (m/^\#( \w+.*)$/) {
+ $cathow = $1;
+ }
next unless m/^reject|^approve|^preapprove/;
- $f{Event}= $_;
+ $f{Event}= $_.$cathow;
last;
}
}
#!/usr/bin/perl -w
-our ($ng,$staticfiles,@ARGV) = @ARGV;
-chdir $ng or die $!;
-
use strict (qw(vars));
use IO::Handle;
use POSIX;
use CGI qw/:standard *table end_* -no_xhtml/;
+our $timesquash = 3;
+# no. of digits at end of time to replace with x, 0..4
+our %reasonshow = qw(approve 1 reject 1);
+# no. of words to show
+
+for (;;) {
+ last unless @ARGV;
+ last unless $ARGV[0] =~ m/^-/;
+ $_ = shift @ARGV;
+ last if m/^--?$/;
+ while (m/^-./) {
+ if (s/^-t([0-4])/-/) {
+ $timesquash= $1;
+ } elsif (s/^-r(\w+)=(\d)$//) {
+ $reasonshow{$1}= $2;
+ } else {
+ die "bad option $_ ?";
+ }
+ }
+}
+
+our ($ng,$staticfiles,@ARGV) = @ARGV;
+chdir $ng or die $!;
+
our @lines= ();
our @s;
our $oddeven = "o";
chomp;
@s= split /\t/;
push @s, '' if @s<=6;
- $s[0]= strftime "%Y-%m-%d %H:%M %Z", localtime $s[0];
- $s[0] =~ s/(\d+\:\d)\d/${1}x/;
+ $s[0]= strftime "%Y-%m-%d %H:%M:%S %Z", localtime $s[0];
+ for (my $i=0; $i<$timesquash; $i++) {
+ $s[0] =~ s/(\d\d:[\d:]*)\d/$1x/;
+ }
+ $s[0] =~ s/:xx / /;
&$processline();
$oddeven =~ y/oe/eo/;
}
$sp[5]= a({ href=>"$staticfiles/nr-$s[6].txt" }, $sp[5] );
}
+ if ($sp[5] =~ m/^\w+\b/ &&
+ defined (my $reasonshow= $reasonshow{$&})) {
+ my @reas= split /\s+/, $sp[5];
+ $reasonshow--;
+ $#reas = $reasonshow if $#reas > $reasonshow;
+ $sp[5] = join ' ', @reas;
+ }
+
print "<tr class='$oddeven'><td>$sp[0]</td>";
print "<td class='ref'>$sp[1] $sp[2]</td>";
print td([@sp[3..5]]),"</tr>\n";