--- shiela.pl 2002/12/22 11:06:50 1.28
+++ shiela.pl 2002/12/22 11:10:42 1.29
@@ -9,8 +9,8 @@
## which can be found at http://www.ossp.org/pkg/tool/shiela/.
##
## This program is free software; you can redistribute it and/or
-## modify it under the terms of the GNU General Public License
-## as published by the Free Software Foundation; either version
+## modify it under the terms of the GNU General Public License
+## as published by the Free Software Foundation; either version
## 2.0 of the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
@@ -18,7 +18,7 @@
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
-## You should have received a copy of the GNU General Public License
+## You should have received a copy of the GNU General Public License
## along with this file; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
@@ -105,7 +105,7 @@
## _________________________________________________________________
##
## Run-time information determination.
-##
+##
## This is a two-stage process, because we need parts of the
## information for parsing the configuration, but OTOH we need the
## configuration for determining other information. To simply solve
@@ -118,7 +118,7 @@
my ($program, $version) = @_;
my $RT = {};
- # program version and name
+ # program version and name
$RT->{vers} = $version;
$RT->{name} = ($program =~ m|^.*?([^/]+?)(?:\.[^/.]+)?$|)[0];
@@ -177,19 +177,19 @@
}
$RT->{sendmail} = $CF->{Environment}->{Program}->{sendmail} ||
&find_program("ssmtp") ||
- &find_program("sendmail") ||
+ &find_program("sendmail") ||
die "unable to find `sendmail' program";
$RT->{cvs} = $CF->{Environment}->{Program}->{cvs} ||
- &find_program("cvs") ||
+ &find_program("cvs") ||
die "unable to find `cvs' program";
$RT->{diff} = $CF->{Environment}->{Program}->{diff} ||
&find_program("diff") ||
'';
$RT->{xdelta} = $CF->{Environment}->{Program}->{xdelta} ||
- &find_program("xdelta") ||
+ &find_program("xdelta") ||
'';
$RT->{uuencode} = $CF->{Environment}->{Program}->{uuencode} ||
- &find_program("uuencode") ||
+ &find_program("uuencode") ||
'';
# pre-calculate a reasonable MIME boundary tag
@@ -222,7 +222,7 @@
##
## C-style configuration syntax parsing.
##
-## <config> ::= <directive>
+## <config> ::= <directive>
## | <config> <directive>
## <directive> ::= <name> ';'
## | <name> <args> ';'
@@ -298,7 +298,7 @@
$t = $';
}
elsif ($t =~ m|^\s+|s) {
- push(@{$A}, $a) if ($a ne '');
+ push(@{$A}, $a) if ($a ne '');
$a = '';
$t = $';
}
@@ -402,7 +402,7 @@
if ($action eq 'CMD' and $cf->[0] =~ m/(Project|Repository|Logging)/) {
my $a;
foreach $a (@{$cf->[1]}) {
- $CF->{$1}->{$a->[0]} = $a->[1]
+ $CF->{$1}->{$a->[0]} = $a->[1]
if ($a->[0] ne 'Users' and
$a->[0] ne 'Groups' and
$a->[0] ne 'Modules' and
@@ -510,7 +510,7 @@
# prepare the pattern
if ($pat =~ m|^m(.)(.+)\1$| and $2 !~ m|$1|) {
# pattern is a regular expression,
- # so just make sure it is anchored
+ # so just make sure it is anchored
$pat =~ s|^([^\^])|^$1|;
$pat =~ s|([^\$])$|$1\$|;
}
@@ -539,7 +539,7 @@
## _________________________________________________________________
##
-## CVS server communication.
+## CVS server communication.
##
## We use this instead of calling the regular CVS client commands
## because we not always have a working directory available (which is
@@ -549,7 +549,7 @@
## process and act as we would be a regular CVS client. For convinience
## reasons, the communication is encapsulated in a "CVS" class object.
## _________________________________________________________________
-##
+##
package CVS;
@@ -561,7 +561,7 @@
my $cvsroot = shift || $ENV{CVSROOT} || die "unknown CVSROOT";
my $trace = shift || 0;
- # spawn a CVS server process and establish a
+ # spawn a CVS server process and establish a
# bidirectional communication path to it.
my $cvs = {};
$cvs->{cvsroot} = $cvsroot;
@@ -622,7 +622,7 @@
$data .= "\n" if ($data !~ m|\n$|s);
$cvs->{wfd}->print($data);
if ($cvs->{trace}) {
- $data =~ s|^|cvs server: -> |mg;
+ $data =~ s|^|cvs server: -> |mg;
print STDERR $data;
}
}
@@ -731,14 +731,14 @@
$sm->{fd} = new IO::Handle;
open($sm->{fd}, "|$RT->{sendmail} -oi -oem $toaddr");
print "sendmail: spawned \"$RT->{sendmail} -oi -oem $toaddr\"\n" if ($sm->{trace});
- $sm->{header} =
+ $sm->{header} =
"From: \"".$RT->{username}."\" <".$RT->{usermail}.">\n" .
"To: $toaddr\n" .
"User-Agent: ".uc(substr($RT->{name}, 0, 1)).substr($RT->{name}, 1)."/$RT->{vers} " .
"CVS/".$RT->{cvsvers}.($RT->{cvsrse} ? "+RSE" : "")."\n" .
"Precedence: bulk\n" .
"Mime-Version: 1.0\n" .
- "Content-Type: text/plain; charset=iso-8859-1\n" .
+ "Content-Type: text/plain; charset=iso-8859-1\n" .
"Content-Transfer-Encoding: 8bit\n";
$sm->{body} = '';
return $sm;
@@ -892,7 +892,7 @@
my @groups = split(/,/, $RT->{usergroups});
my $file;
foreach $file (@files) {
- $file =~ m|^([^/]+)/(.*):([^:]+)$|
+ $file =~ m|^([^/]+)/(.*):([^:]+)$|
|| die "invalid file specification `$file' for access control";
my ($d, $f, $t) = ($1, $2, $3);
my $allow = 0;
@@ -924,7 +924,7 @@
}
if ( ( not $not
and ($u eq '*' or $u eq $user)
- and ($g eq '*' or grep(m/^$g$/, @groups)))
+ and ($g eq '*' or grep(m/^$g$/, @groups)))
or ( $not
and ($u ne '*' and $u ne $user)
and ($g ne '*' and not grep(m/^$g$/, @groups)))) {
@@ -1005,7 +1005,7 @@
my $cvsdirphysical = Cwd::realpath($RT->{cvsroot});
$cvsdir =~ s|^$cvsdirphysical/?||;
- # provide access control
+ # provide access control
my @paths = ();
foreach my $cvsfile (keys(%cvsfiles)) {
push(@paths, "$cvsdir/$cvsfile:*");
@@ -1013,7 +1013,7 @@
my @denyfiles = &do_access_control($PA, $RT, $CF, @paths);
if ($#denyfiles > -1) {
# inform user
- print "cvs tag: Access Denied - Insufficient Karma!\n";
+ print "cvs tag: Access Denied - Insufficient Karma!\n";
print "cvs tag: Tagging access for the following file(s) was denied:\n";
foreach my $file (@denyfiles) {
print "cvs tag: `$file'\n";
@@ -1062,7 +1062,7 @@
my ($cvsdir, @cvsfiles) = @{$PA->{ARG}};
$cvsdir =~ s|^$RT->{cvsroot}/?||;
- # provide access control
+ # provide access control
my @paths = ();
foreach my $cvsfile (@cvsfiles) {
push(@paths, "$cvsdir/$cvsfile:*");
@@ -1070,7 +1070,7 @@
my @denyfiles = &do_access_control($PA, $RT, $CF, @paths);
if ($#denyfiles > -1) {
# inform user
- print "cvs admin: Access Denied - Insufficient Karma!\n";
+ print "cvs admin: Access Denied - Insufficient Karma!\n";
print "cvs admin: Admin access for the following file(s) was denied:\n";
foreach my $file (@denyfiles) {
print "cvs admin: `$file'\n";
@@ -1118,7 +1118,7 @@
my ($cvsbranch, $cvsdir, @cvsfiles) = @{$PA->{ARG}};
$cvsdir =~ s|^$RT->{cvsroot}/?||;
- # provide access control
+ # provide access control
my @paths = ();
foreach my $cvsfile (@cvsfiles) {
push(@paths, "$cvsdir/$cvsfile:$cvsbranch");
@@ -1126,7 +1126,7 @@
my @denyfiles = &do_access_control($PA, $RT, $CF, @paths);
if ($#denyfiles > -1) {
# inform user
- print "cvs import: Access Denied - Insufficient Karma!\n";
+ print "cvs import: Access Denied - Insufficient Karma!\n";
print "cvs import: Import access for the following files was denied:\n";
foreach my $file (@denyfiles) {
print "cvs import: `$file'\n";
@@ -1216,7 +1216,7 @@
}
@cvsfiles = @newfiles;
- # provide access control
+ # provide access control
my @paths = ();
foreach my $cvsfile (@cvsfiles) {
push(@paths, "$cvsdir/$cvsfile");
@@ -1224,7 +1224,7 @@
my @denyfiles = &do_access_control($PA, $RT, $CF, @paths);
if ($#denyfiles > -1) {
# inform user
- print "cvs commit: Access Denied - Insufficient Karma!\n";
+ print "cvs commit: Access Denied - Insufficient Karma!\n";
print "cvs commit: Commit access for the following file(s) was denied:\n";
foreach my $file (@denyfiles) {
print "cvs commit: `$file'\n";
@@ -1297,7 +1297,7 @@
$io->close;
# nuke possibly existing editor backup files
- unlink("${logfile}~");
+ unlink("${logfile}~");
unlink("${logfile}.bak");
return $rv;
@@ -1330,7 +1330,7 @@
# determine whether we are the last call
my $islastcall = ($RT->{cvsop} eq 'import' ? 1 : 0);
if (-f "$RT->{tmpfile}.lastdir") {
- my ($lastdir) = &do_file('read', "$RT->{tmpfile}.lastdir", '');
+ my ($lastdir) = &do_file('read', "$RT->{tmpfile}.lastdir", '');
$islastcall = 1 if ($lastdir eq $cvsdir);
}
@@ -1364,7 +1364,7 @@
# collect the information
sub hook_loginfo_collect {
my ($PA, $RT, $CF) = @_;
-
+
# take the arguments
my ($cvsdir, @cvsinfo) = split(/\s+/, $PA->{ARG}->[0]);
@@ -1503,7 +1503,7 @@
if ($line =~ m/^Modified Files/) { $state = 'M'; next; }
if ($line =~ m/^Removed Files/) { $state = 'R'; next; }
if ($line =~ m/^Log Message/) { $state = '-'; next; }
-
+
if ($state =~ m/^[AMR]$/) {
my $file;
foreach $file (split(/\s+/, $line)) {
@@ -1567,7 +1567,7 @@
}
}
- # read file log entry
+ # read file log entry
my $rcslog = '';
if ($Io eq 'A' or $Io eq 'M' or $Io eq 'R') {
if (not $RT->{useserver}) {
@@ -1602,7 +1602,7 @@
# determine change delta
my $Id = '+0/-0';
- if ($Ik eq 'b' or -B $Is) {
+ if ($Ik eq 'b' or -B $Is) {
$Id = 'BLOB';
}
else {
@@ -1660,10 +1660,10 @@
}
$io->close;
- if ($Ik eq 'b' or -B $Is) {
+ if ($Ik eq 'b' or -B $Is) {
# generate binary change patch script
if ($RT->{xdelta} and $RT->{uuencode}) {
- $cvsdiff .=
+ $cvsdiff .=
"<shiela:patch $cvsdir/$Is>\n" .
"(cd $cvsdir && uudecode <<'@@ .' && \\\n" .
" xdelta patch $Is.xdelta /dev/null $Is && \\\n" .
@@ -1690,7 +1690,7 @@
else {
# generate textual change patch script
if ($RT->{diff}) {
- $cvsdiff .=
+ $cvsdiff .=
"<shiela:patch $cvsdir/$Is>\n" .
"patch -p0 <<'@@ .'\n" .
"Index: $cvsdir/$Is\n" .
@@ -1717,7 +1717,7 @@
## MODIFIED FILE
##
- if ($Ik eq 'b' or -B $Is) {
+ if ($Ik eq 'b' or -B $Is) {
# generate binary change patch script
if ($RT->{xdelta} and $RT->{uuencode}) {
@@ -1764,7 +1764,7 @@
$io->close;
# generate change patch script
- $cvsdiff .=
+ $cvsdiff .=
"<shiela:patch $cvsdir/$Is>\n" .
"(cd $cvsdir && uudecode <<'@@ .' && \\\n" .
" mv $Is $Is.orig && xdelta patch $Is.xdelta $Is.orig $Is && \\\n" .
@@ -1908,7 +1908,7 @@
if (defined($handle_min) and defined($handle_max)) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($handle_min);
$IN->{handle} = sprintf("%04d%02d%02d%02d%02d%02d%02d",
- 1900+$year, $mon+1, $mday, $hour, $min, $sec,
+ 1900+$year, $mon+1, $mday, $hour, $min, $sec,
$handle_max - $handle_min);
}
return $IN;
@@ -1972,7 +1972,7 @@
$sm->header('Subject', $subject);
if (defined($CF->{Logging}->{Report}->{$logtype}->{Details})) {
if ($CF->{Logging}->{Report}->{$logtype}->{Details} eq 'patch:mime') {
- $sm->header('Content-Type',
+ $sm->header('Content-Type',
"multipart/mixed; boundary=\"".$RT->{mimeboundary}."\"");
}
}
@@ -1996,10 +1996,10 @@
sub produce_log_message {
my ($PA, $RT, $CF, $IN, $type, @files) = @_;
- #
+ #
# Parse out more details.
#
- my $cvslist = {};
+ my $cvslist = {};
my %cvsmodules = ();
my %cvsbranches = ();
my $file;
@@ -2064,7 +2064,7 @@
$prefix . sprintf("%-40s %s\n", "Module: ".$IN->{cvsmodule}, "Date: ".$date) .
$prefix . sprintf("%-40s %s\n", "Branch: ".$IN->{cvsbranch}, "Handle: ".$IN->{handle});
}
-
+
# the file list
elsif ($content eq 'files') {
$O .= "\n";
@@ -2147,13 +2147,13 @@
$O .= $prefix." Revision Changes Path\n";
foreach $file (sort(keys(%{$IN->{file}}))) {
my ($op, $rev, $delta) = ($IN->{file}->{$file}->{op},
- $IN->{file}->{$file}->{newrev},
+ $IN->{file}->{$file}->{newrev},
$IN->{file}->{$file}->{delta});
next if ($op eq 'T');
if ($delta =~ m|^(.+)/(.+)$|) {
$delta = sprintf("%-3s %-3s", $1, $2);
}
- $O .= $prefix.sprintf(" %-12s%-12s%s\n", $rev, $delta, $file);
+ $O .= $prefix . sprintf(" %-12s%-12s%s\n", $rev, $delta, $file);
}
}
|