X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fgen-indices.in;h=73243b8e5119b0d6cc9ee3a6432c36d88abe6157;hb=41f4070218c0b11c803e7bfea1ba5801b40479b5;hp=59e0fe9ed396c2c133e248223ff23570e2a38f78;hpb=56c8b1f04cc87d093f22f1767c233158a00a1663;p=debbugs.git diff --git a/scripts/gen-indices.in b/scripts/gen-indices.in index 59e0fe9..73243b8 100755 --- a/scripts/gen-indices.in +++ b/scripts/gen-indices.in @@ -76,7 +76,7 @@ pod2usage(1) if $options{help}; pod2usage(-verbose=>2) if $options{man}; use Debbugs::Config qw(:config); -use Debbugs::Common qw(getparsedaddrs); +use Debbugs::Common qw(getparsedaddrs getbugcomponent); use Debbugs::Status qw(readbug); chdir($config{spool_dir}) or die "chdir $config{spool_dir} failed: $!"; @@ -167,7 +167,7 @@ my @dirs = ($initialdir); while (my $dir = shift @dirs) { printf "Doing dir %s ...\n", $dir if $verbose; - opendir(DIR, "$dir/.") or die "opendir $dir: $!\n"; + opendir(DIR, "$dir/.") or die "opendir $dir: $!"; my @subdirs = readdir(DIR); closedir(DIR); @@ -176,15 +176,20 @@ while (my $dir = shift @dirs) { for my $bug (@list) { print "Up to $cnt bugs...\n" if (++$cnt % 100 == 0 && $verbose); - my $stat = stat(getbugcomponent($bug,'summary')); + my $stat = stat(getbugcomponent($bug,'summary',$initialdir)); + if (not defined $stat) { + print STDERR "Unable to stat $bug $!\n"; + next; + } next if $stat->mtime < $time; my $fdata = readbug($bug, $initialdir); addbugtoindex("package", $bug, split /[\s,]+/, $fdata->{"package"}); addbugtoindex("tag", $bug, split /[\s,]+/, $fdata->{"keywords"}); addbugtoindex('submitter-email', $bug, - map {$_->address} getparsedaddrs($fdata->{originator})); + map {lc($_->address)} getparsedaddrs($fdata->{originator})); addbugtoindex("severity", $bug, $fdata->{"severity"}); - addbugtoindex("owner", $bug, $fdata->{"owner"}); + addbugtoindex("owner", $bug, + map {lc($_->address)} getparsedaddrs($fdata->{"owner"})); } }