added error checking; moved vconfigurables to top of file; made cvs commit not spew noise to the webserver error log

This commit is contained in:
dmose%mozilla.org 2000-03-07 22:51:08 +00:00
parent 40b5b61ac3
commit 549c5b38af

View File

@ -18,11 +18,17 @@
# Rights Reserved. # Rights Reserved.
# #
# Contributor(s): Terry Weissman <terry@mozilla.org> # Contributor(s): Terry Weissman <terry@mozilla.org>
# Dan Mosedale <dmose@mozilla.org>
# $F::debug = 1; # $F::debug = 1;
$cvs = "/opt/cvs-tools/bin/cvs"; $cvs = "/opt/cvs-tools/bin/cvs";
$whoami = "/usr/ucb/whoami";
$perlbin = "/tools/ns/bin/perl5.004
#$cvs = "/usr/bin/cvs";
#$whoami = "/usr/bin/whoami";
#$perlbin = "/usr/bin/perl";
$dontcommit = 0; $dontcommit = 0;
$usertoblame = ""; $usertoblame = "";
@ -51,7 +57,7 @@ $db = Mysql->Connect("localhost", "mozusers")
$db = $db; # Make -w shut up. $db = $db; # Make -w shut up.
($mylogin = `/usr/ucb/whoami`) || ($mylogin = `/bin/whoami`); ($mylogin = `$whoami`);
chop($mylogin); chop($mylogin);
$hostname = 'unknown'; $hostname = 'unknown';
@ -117,7 +123,6 @@ while (@reprow = $repquery->fetchrow()) {
push @filelist, "${g}_list"; push @filelist, "${g}_list";
} }
} }
system "$cvs co " . join(' ', grep(s@^@CVSROOT/@, @filelist)) system "$cvs co " . join(' ', grep(s@^@CVSROOT/@, @filelist))
|| die "Couldn't checkout files."; || die "Couldn't checkout files.";
@ -162,7 +167,7 @@ while (@reprow = $repquery->fetchrow()) {
$outfile = "CVSROOT/commitcheck.pl"; $outfile = "CVSROOT/commitcheck.pl";
open(COMMITCHECK, ">$outfile") || die "Can't open $outfile"; open(COMMITCHECK, ">$outfile") || die "Can't open $outfile";
print COMMITCHECK "#!/tools/ns/bin/perl5.004 --\n"; print COMMITCHECK "#!$perlbin --\n";
print COMMITCHECK "# DO NOT EDIT THIS FILE! You must instead go to http://despot.mozilla.org/, and\n"; print COMMITCHECK "# DO NOT EDIT THIS FILE! You must instead go to http://despot.mozilla.org/, and\n";
print COMMITCHECK "# tweak things from there.\n\n"; print COMMITCHECK "# tweak things from there.\n\n";
@ -235,9 +240,11 @@ while (@reprow = $repquery->fetchrow()) {
if ($dontcommit) { if ($dontcommit) {
system "$cvs diff -c passwd"; system "$cvs diff -c passwd";
system "$cvs diff -c commitcheck.pl"; system "$cvs diff -c commitcheck.pl";
# system "$cvs commit -m 'Pseudo-automatic update of changes made by $usertoblame.' commitcheck.pl"; # system "$cvs -q commit -m 'Pseudo-automatic update of changes made by $usertoblame.' commitcheck.pl";
} else { } else {
system "$cvs commit -m 'Pseudo-automatic update of changes made by $usertoblame.'"; system ("$cvs -q commit -m 'Pseudo-automatic update of changes" .
" made by $usertoblame.'") == 0
or die "cvs commit failed";
} }
@ -352,7 +359,9 @@ Documents:</TH><TD>";
close OWNERS; close OWNERS;
system "$cvs commit -m 'Pseudo-automatic update of changes made by $usertoblame.'"; system ( "$cvs -q commit -m 'Pseudo-automatic update of changes" .
" made by $usertoblame.'" ) == 0
or die "cvs commit failed";
} }
chdir "/"; chdir "/";