2 # $Id: processall.in,v 1.7 2001/08/16 07:20:18 doogie Exp $
6 # Uses up: incoming/I<code><bugnum>.nn
7 # Temps: incoming/[GP].nn
8 # Creates: incoming/E.nn
11 $config_path = '/org/bugs.debian.org/etc';
12 $lib_path = '/org/bugs.debian.org/scripts';
14 require "$config_path/config";
15 require "$lib_path/errorlib";
16 $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
18 chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
19 push( @INC, "$lib_path" );
28 &filelock('incoming-cleaner');
31 print(STDERR "stop file created\n") || die $!;
35 opendir(DIR,"incoming") || die $!;
36 while ( defined( $_= readdir(DIR) )) { push(@ids,$_) if s/^I//; }
40 stat("$gMaintainerFile") || die "stat $gMaintainerFile: $!\n";
43 unless (rename("incoming/I$id","incoming/G$id")) {
45 die "$id already fudged once! $!\n";
50 if ($id =~ m/^[RC]/) {
51 print(STDOUT "[$nf] $id service ...") || die $!;
52 defined($c=fork) || die $!;
53 if (!$c) { exec("$lib_path/service",$id); die $!; }
54 } elsif ($id =~ m/^[BMQFDU]/) {
55 print(STDOUT "[$nf] $id process ...") || die $!;
56 defined($c=fork) || die $!;
57 if (!$c) { exec("$lib_path/process",$id); die $!; }
61 $cc=waitpid($c,0); $cc == $c || die "$cc $c $!";
64 print(STDERR "$id: process failed ($status $!) - now in [PG]$id\n") || die $!;
66 print(STDOUT " done\n") || die $!;