2 # $Id: processall.in,v 1.2 1999/09/02 22:27:29 gecko Exp $
6 # Uses up: incoming/I<code><bugnum>.nn
7 # Temps: incoming/[GP].nn
8 # Creates: incoming/E.nn
11 require( '/etc/debbugs/config' );
12 $ENV{'PATH'} = '/usr/lib/debbugs'.$ENV{'PATH'};
13 chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
14 push( @INC, '/usr/lib/debbugs' );
23 print(STDERR "stop file created\n") || die $!;
27 opendir(DIR,"incoming") || die $!;
28 while ($_= readdir(DIR)) { push(@ids,$_) if s/^I//; }
32 stat("$gMaintainerFile") || die "stat $gMaintainerFile: $!\n";
35 unless (rename("incoming/I$id","incoming/G$id")) {
37 die "$id already fudged once! $!\n";
42 if ($id =~ m/^[RC]/) {
43 print(STDOUT "[$nf] $id service ...") || die $!;
44 defined($c=fork) || die $!;
45 if (!$c) { exec("/usr/lib/debbugs/service",$id); die $!; }
46 } elsif ($id =~ m/^[BMQFDU]/) {
47 print(STDOUT "[$nf] $id process ...") || die $!;
48 defined($c=fork) || die $!;
49 if (!$c) { exec("/usr/lib/debbugs/process",$id); die $!; }
53 $cc=waitpid($c,0); $cc == $c || die "$cc $c $!";
56 print(STDERR "$id: process failed ($status $!) - now in [PG]$id\n") || die $!;
58 print(STDOUT " done\n") || die $!;