]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Handle archive directories correctly
authorDon Armstrong <don@donarmstrong.com>
Tue, 19 Jun 2007 12:47:54 +0000 (05:47 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 19 Jun 2007 12:47:54 +0000 (05:47 -0700)
 * Indicate when we fail to stat a bug
 * Ditch useless \n

scripts/gen-indices.in

index 730880a067d8d25f9fe318cd30eee4ca1d2248eb..73243b8e5119b0d6cc9ee3a6432c36d88abe6157 100755 (executable)
@@ -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"});