From: Don Armstrong Date: Tue, 19 Jun 2007 12:47:54 +0000 (-0700) Subject: * Handle archive directories correctly X-Git-Tag: release/2.6.0~546^2~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=87d4184d2ac1e0fc834c81532a9378ff2c5debbb;p=debbugs.git * Handle archive directories correctly * Indicate when we fail to stat a bug * Ditch useless \n --- diff --git a/scripts/gen-indices.in b/scripts/gen-indices.in index 730880a0..73243b8e 100755 --- a/scripts/gen-indices.in +++ b/scripts/gen-indices.in @@ -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,7 +176,11 @@ 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"});