2 # $Id: processall.in,v 1.5 2001/07/15 10:05:23 doogie 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 require( '/usr/lib/debbugs/errorlib' );
13 $ENV{'PATH'} = '/usr/lib/debbugs:'.$ENV{'PATH'};
14 chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
15 push( @INC, '/usr/lib/debbugs' );
22 &filelock('incoming-cleaner');
25 print(STDERR "stop file created\n") || die $!;
29 opendir(DIR,"incoming") || die $!;
30 while ( defined( $_= readdir(DIR) )) { push(@ids,$_) if s/^I//; }
34 stat("$gMaintainerFile") || die "stat $gMaintainerFile: $!\n";
37 unless (rename("incoming/I$id","incoming/G$id")) {
39 die "$id already fudged once! $!\n";
44 if ($id =~ m/^[RC]/) {
45 print(STDOUT "[$nf] $id service ...") || die $!;
46 defined($c=fork) || die $!;
47 if (!$c) { exec("/usr/lib/debbugs/service",$id); die $!; }
48 } elsif ($id =~ m/^[BMQFDU]/) {
49 print(STDOUT "[$nf] $id process ...") || die $!;
50 defined($c=fork) || die $!;
51 if (!$c) { exec("/usr/lib/debbugs/process",$id); die $!; }
55 $cc=waitpid($c,0); $cc == $c || die "$cc $c $!";
58 print(STDERR "$id: process failed ($status $!) - now in [PG]$id\n") || die $!;
60 print(STDOUT " done\n") || die $!;