open(BOILERPLATE,"<commitcheck.templ")||die"Can't open template file";
while(<BOILERPLATE>){
if( /^#/){
# Strip out comments from the boilerplate. Might as well; the
# faster our generated perl script runs, the better.
next;
}
$boilerplate.=$_;
}
closeBOILERPLATE;
$repquery=Query("select id,name,cvsroot from repositories order by name");
while(@reprow=$repquery->fetchrow()){
($repid,$repname,$reproot)=(@reprow);
$query=Query("select email,passwd,${repname}_group,neednewpassword from users where ${repname}_group != 'None' and passwd != '' order by email");
$tmpdir="/tmp/syncit.$$";
mkdir$tmpdir,0777;
chdir$tmpdir;
$ENV{CVSROOT}=$reproot;
system"$cvs co CVSROOT/passwd CVSROOT/commitcheck.pl"||die"Couldn't checkout files.";
$outfile="CVSROOT/passwd";
open(PASSWD,">$outfile")||die"Can't open $outfile";
printPASSWD"# DO NOT EDIT THIS FILE! You must instead go to http://warp/mozilla.org, and\n";
printPASSWD"# tweak things from there.\n";
while(@row=$query->fetchrow()){
($email,$password,$group,$neednew)=@row;
if($needneweq"Yes"){
next;
}
$login=$email;
$login=~s/@/%/g;
printPASSWD"$login:$password:$group\n";
}
closePASSWD;
# system "$cvs co CVSROOT/commitcheck.pl" || die "Couldn't checkout passwd file.";
$outfile="CVSROOT/commitcheck.pl";
open(COMMITCHECK,">$outfile")||die"Can't open $outfile";
printCOMMITCHECK"#!/tools/ns/bin/perl5.004 --\n";
printCOMMITCHECK"# DO NOT EDIT THIS FILE! You must instead go to http://cvs-mirror.mozilla.org/webtools/despot, and\n";
printCOMMITCHECK"# tweak things from there.\n\n";
$query=Query("select partitions.id,partitions.name,state,branches.name from partitions,branches where repositoryid = '$repid' and branches.id=branchid order by partitions.name");
$query=Query("select branches.name,partitions.id from partitions,branches where repositoryid = '$repid' and state != 'Open' and branches.id = branchid order by branches.name");