- find(sub {
- print STDERR "Examining $_\n" if $DEBUG;
- return if not /^(\d+)\.log$/;
- my $bug_num = $1;
- my $stat = stat $_ or next;
- return unless -f _;
- return if exists $timestamps{$File::Find::dir} and
- $timestamps{$File::Find::dir} > $stat->mtime;
- $seen_dirs{$File::Find::dir} = $start_time;
- add_bug_log($node,$1);
- },
- map {(-d "$options{spool}/$_")?"$options{spool}/$_":()}
- qw(db-h archived db),
- );
- # write timestamp file
- if (defined $options{timestamp}) {
- %timestamps = (%timestamps,%seen_dirs);
- my $timestamp_fh = new IO::File $options{timestamp},'w' or
- die "Unable to open timestamp $options{timestamp}: $!";
- foreach my $key (keys %timestamps) {
- print {$timestamp_fh} $key,' ',
- $timestamps{$key}||'',qq(\n);
+ for my $hash (map {sprintf '%02d',$_ } 0..99) {
+ find(sub {
+ print STDERR "Examining $_\n" if $DEBUG > 1;
+ return if not /^(\d+)\.log$/;
+ my $bug_num = $1;
+ my $stat = stat $_ or next;
+ return unless -f _;
+ return if exists $timestamps{$File::Find::dir} and
+ ($timestamps{$File::Find::dir} > $stat->mtime);
+ $seen_dirs{$File::Find::dir} = $start_time;
+ print STDERR "Adding $bug_num\n" if $DEBUG;
+ my $max_message = 0;
+ eval{
+ $max_message = add_bug_log($node,$bug_num);
+ };
+ if ($@) {
+ print STDERR "Adding $bug_num failed with $@\n";
+ }
+ },
+ map {(-d "$options{spool}/$_/$hash")?
+ "$options{spool}/$_/$hash":()}
+ qw(db-h archive),
+ );
+ # write timestamp file
+ if (defined $options{timestamp}) {
+ %timestamps = (%timestamps,%seen_dirs);
+ my $timestamp_fh = new IO::File $options{timestamp},'w' or
+ die "Unable to open timestamp $options{timestamp}: $!";
+ foreach my $key (keys %timestamps) {
+ print {$timestamp_fh} $key,' ',
+ $timestamps{$key}||'',qq(\n);
+ }