2 # $Id: processall.in,v 1.13 2005/10/06 03:46:13 ajt Exp $
6 # Uses up: incoming/I<code><bugnum>.nn
7 # Temps: incoming/[GP].nn
8 # Creates: incoming/E.nn
11 $config_path = '/etc/debbugs';
12 $lib_path = '/usr/lib/debbugs';
14 require "$config_path/config";
15 require "$lib_path/errorlib";
16 $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
20 chdir( $gSpoolDir ) || die "chdir spool: $!\n";
21 push( @INC, $lib_path );
30 &filelock('incoming-cleaner');
33 print(STDERR "stop file created\n") || die $!;
37 opendir(DIR,"incoming") || die $!;
38 while ( defined( $_= readdir(DIR) )) { push(@ids,$_) if s/^I//; }
42 stat("$gMaintainerFile") || die "stat $gMaintainerFile: $!\n";
45 unless (rename("incoming/I$id","incoming/G$id")) {
47 die "$id already fudged once! $!\n";
52 if ($id =~ m/^[RC]/) {
53 print(STDOUT "[$nf] $id service ...") || die $!;
54 defined($c=fork) || die $!;
55 if (!$c) { exec("$lib_path/service",$id); die $!; }
56 } elsif ($id =~ m/^[BMQFDUL]/) {
57 print(STDOUT "[$nf] $id process ...") || die $!;
58 defined($c=fork) || die $!;
59 if (!$c) { exec("$lib_path/process",$id); die $!; }
63 $cc=waitpid($c,0); $cc == $c || die "$cc $c $!";
66 print(STDERR "$id: process failed ($status $!) - now in [PG]$id\n") || die $!;
68 print(STDOUT " done\n") || die $!;
69 rmtree("$gSpoolDir/mime.tmp",0,1);