--- shiela 2001/05/11 19:54:23 1.7
+++ shiela 2001/05/12 07:28:25 1.8
@@ -25,7 +25,7 @@
## shiela: Shiela control program (syntax: Perl)
##
-my $version = '0.9.0';
+my $version = '0.9.2';
require 5.005;
@@ -125,7 +125,7 @@
# supplied arguments
$RT->{cvsroot} = $ENV{CVSROOT} || die 'unknown CVS root (set $CVSROOT variable)';
- $RT->{userid} = $ENV{LOGNAME} || $ENV{LOGUSER} || $ENV{USER} || die 'unknown CVS user';
+ $RT->{userid} = $ENV{CVSUSER} || $ENV{LOGNAME} || $ENV{LOGUSER} || $ENV{USER} || die 'unknown CVS user';
# various directory paths
$RT->{tmpdir} = $ENV{TMPDIR} || $ENV{TEMPDIR} || '/tmp';
@@ -146,7 +146,7 @@
# determine user information
$RT->{username} = $CF->{Project}->{User}->{$RT->{userid}}->{name} ||
- die "unknown user `$RT->{userid}'";
+ die "CVS user `$RT->{userid}' not found in Shiela configuration";
$RT->{usermail} = $CF->{Project}->{User}->{$RT->{userid}}->{mail} ||
"$RT->{userid}\@localhost";
@@ -193,7 +193,7 @@
$RT->{cvsvers} = $1 if ($v =~ m|Concurrent\s+Versions\s+System\s+\(CVS\)\s+([\d.]+)\s+|s);
$RT->{cvsossp} = 0;
$RT->{cvsossp} = 1 if ($v =~ m|OSSP|s);
- die "$RT->{cvs} is not at least CVS 1.10" if ($RT->{cvsvers} !~ m|^1\.10|);
+ die "$RT->{cvs} is not at least CVS 1.10" if ($RT->{cvsvers} !~ m|^1\.1[0-9]|);
$RT->{useserver} = 0;
$RT->{useserver} = 1 if ($v =~ m|server|s);
@@ -490,7 +490,7 @@
# prepare the pattern
if ($pat =~ m|^m(.)(.+)\1$| and $2 !~ m|$1|) {
# pattern is a regular expression,
- # so just make sure it is achored
+ # so just make sure it is anchored
$pat =~ s|^([^\^])|^$1|;
$pat =~ s|([^\$])$|$1\$|;
}
@@ -1182,7 +1182,7 @@
my @newfiles = ();
foreach my $cvsfile (@cvsfiles) {
my $branch = 'HEAD';
- my $cvsfile_quoted = quotemeta($cvsfile);
+ my $cvsfile_quoted = quotemeta($cvsfile);
if ($cvsstat =~ m|===+\nFile:\s+${cvsfile_quoted}.+?Sticky Tag:\s+(\S+)|s) {
$branch = $1;
$branch = 'HEAD' if ($branch eq '(none)');
@@ -1403,7 +1403,7 @@
print STDERR "cvs import: Ignoring this operation - don't expect log messages!\n";
exit(0);
}
- open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$It $Is|");
+ open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$It '$Is'|");
$rcslog = $_ while (<CVSS>);
close(CVSS);
}
@@ -1519,7 +1519,7 @@
my $rcslog = '';
if ($Io eq 'A' or $Io eq 'M') {
if (not $RT->{useserver}) {
- open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$Iv $Is|");
+ open(CVSS, "$RT->{cvs} -f -l -Q -n log -r$Iv '$Is'|");
$rcslog .= $_ while (<CVSS>);
close(CVSS);
}
@@ -1579,7 +1579,7 @@
"============================================================\n" .
"\$ cvs update -p -r$Iv $Is | uuencode $Is\n";
if (not $RT->{useserver}) {
- open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv $Is | uuencode $Is |");
+ open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv '$Is' | uuencode '$Is' |");
$cvsdiff .= $_ while (<CVSS>);
close(CVSS);
}
@@ -1602,7 +1602,7 @@
"============================================================\n" .
"\$ cvs update -p -r$Iv $Is\n";
if (not $RT->{useserver}) {
- open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv $Is|");
+ open(CVSS, "$RT->{cvs} -f -l -Q -n update -p -r$Iv '$Is'|");
$cvsdiff .= $_ while (<CVSS>);
close(CVSS);
}
@@ -1629,8 +1629,8 @@
"\$ cvs update -p -r$Iv $Is >$Is.new\n" .
"\$ diff -u $Is.old $Is.new\n";
if (not $RT->{useserver}) {
- system("$RT->{cvs} -f -l -Q -n update -p -r$IV $Is | uuencode $Is >$Is.old");
- system("$RT->{cvs} -f -l -Q -n update -p -r$Iv $Is | uuencode $Is >$Is.new");
+ system("$RT->{cvs} -f -l -Q -n update -p -r$IV '$Is' | uuencode '$Is' >$Is.old");
+ system("$RT->{cvs} -f -l -Q -n update -p -r$Iv '$Is' | uuencode '$Is' >$Is.new");
}
else {
my $cvs = new CVS ($RT->{cvs}, $RT->{cvsroot});
@@ -1659,7 +1659,7 @@
# file was modified, so we show the changed contents only
my $d = '';
if (not $RT->{useserver}) {
- open(FP, "$RT->{cvs} -f -l -Q -n diff -u -r$IV -r$Iv $Is|");
+ open(FP, "$RT->{cvs} -f -l -Q -n diff -u -r$IV -r$Iv '$Is'|");
$d .= $_ while (<FP>);
close(FP);
}
@@ -1672,9 +1672,10 @@
$d .= scalar $cvs->result;
$cvs->close;
}
+ my $Is_quoted = quotemeta($Is);
$d =~ s|^Index:.+?\ndiff\s+.*?\n||s;
- $d =~ s|^(---\s+)$Is(\s+)|$1$cvsdir/$Is$2|m;
- $d =~ s|^(\+\+\+\s+)$Is(\s+)|$1$cvsdir/$Is$2|m;
+ $d =~ s|^(---\s+)${Is_quoted}(\s+)|$1$cvsdir/$Is$2|m;
+ $d =~ s|^(\+\+\+\s+)${Is_quoted}(\s+)|$1$cvsdir/$Is$2|m;
$cvsdiff .=
"<Diff $cvsdir/$Is>\n" .
"Index: $cvsdir/$Is\n" .
@@ -1747,7 +1748,7 @@
$e->{date} = $ID;
$e->{delta} = $Id;
$e->{diff} = '';
- my $Is_quoted = quotemeta($Is);
+ my $Is_quoted = quotemeta($Is);
$cvsdiff =~ s|\n<Diff\s+${Is_quoted}>\n(.+?\n)</Diff>|$e->{diff} = $1, ''|se;
$IN->{file}->{$Is} = $e;
$handle_min = $ID if ($ID ne '' and (not defined($handle_min) or $handle_min > $ID));
|