despot now also automatically creates mailing lists of people who can

check into a repository.


git-svn-id: svn://10.0.0.236/trunk@17658 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
terry%netscape.com 1999-01-13 20:31:36 +00:00
parent bd27d339e7
commit 8f4dfd10d3
2 changed files with 39 additions and 11 deletions

View File

@ -44,7 +44,7 @@ create table repositories (
cvsroot varchar(255) not null,
ownersrepository smallint,
ownerspath varchar(255),
domailing tinyint not null,
unique(name)
);

View File

@ -94,20 +94,51 @@ close BOILERPLATE;
$repquery = Query("select id,name,cvsroot,ownersrepository,ownerspath from repositories order by name");
my @grouplist = ('cvs', 'gila'); # Mailing group list. Should really query
# for this list rom the db ... ###
$repquery = Query("select id,name,cvsroot,ownersrepository,ownerspath,domailing from repositories order by name");
while (@reprow = $repquery->fetchrow()) {
($repid,$repname,$reproot,$ownersrepository,$ownerspath) = (@reprow);
($repid,$repname,$reproot,$ownersrepository,$ownerspath,$domailing) =
(@reprow);
$query = Query("select email,passwd,${repname}_group,neednewpassword,disabled from users where ${repname}_group != 'None' and passwd != '' order by email");
$tmpdir = "/tmp/syncit.$$";
$tmpdir = "/tmp/syncit-$repname.$$";
mkdir $tmpdir, 0777;
chdir $tmpdir;
$ENV{CVSROOT} = $reproot;
system "$cvs co CVSROOT/passwd CVSROOT/commitcheck.pl" || die "Couldn't checkout files.";
my @filelist = ('passwd', 'commitcheck.pl');
if ($domailing) {
foreach my $g (@grouplist) {
push @filelist, "${g}_list";
}
}
system "$cvs co " . join(' ', grep(s@^@CVSROOT/@, @filelist))
|| die "Couldn't checkout files.";
if ($domailing) {
foreach my $group (@grouplist) {
$outfile = "CVSROOT/${group}_list";
open(MAILLIST, ">$outfile") || die "Can't open $outfile";
print MAILLIST "# DO NOT EDIT THIS FILE! This file is created\n";
print MAILLIST "# by despot, and is used by /etc/aliases.\n";
my $q = Query("select email from users where ${group}_group != 'None' and passwd != '' and disabled != 'Yes' order by email");
while (@r = $q->fetchrow()) {
print MAILLIST $r[0]. "\n";
}
close MAILLIST;
}
}
$outfile = "CVSROOT/passwd";
open(PASSWD, ">$outfile") || die "Can't open $outfile";
@ -322,14 +353,11 @@ Documents:</TH><TD>";
system "$cvs commit -m 'Pseudo-automatic update of changes made by $usertoblame.'";
}
chdir "/";
system "rm -rf $tmpdir";
# system "rm -rf $tmpdir";
}