]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Use split_status_fields
authorDon Armstrong <don@donarmstrong.com>
Tue, 21 Jul 2009 12:45:32 +0000 (05:45 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 21 Jul 2009 12:45:32 +0000 (05:45 -0700)
 * Use affects properly in gen-indices

scripts/gen-indices

index c929db6544565649c3b7a2d85c30232a2fc81fdc..ff269963541658a69e665a0c755b1bc59f2bbd4e 100755 (executable)
@@ -79,7 +79,7 @@ pod2usage(-verbose=>2) if $options{man};
 
 use Debbugs::Config qw(:config);
 use Debbugs::Common qw(getparsedaddrs getbugcomponent lockpid);
-use Debbugs::Status qw(readbug);
+use Debbugs::Status qw(readbug split_status_fields);
 use Debbugs::Log;
 
 chdir($config{spool_dir}) or die "chdir $config{spool_dir} failed: $!";
@@ -106,7 +106,7 @@ if (not lockpid($config{spool_dir}.'/lock/gen-indices')) {
 }
 
 # NB: The reverse index is special; it's used to clean up during updates to bugs
-my @indexes = ('package', 'tag', 'severity','owner','submitter-email','status','correspondent','reverse');
+my @indexes = ('package', 'tag', 'severity','owner','submitter-email','status','correspondent','affects','reverse');
 my $indexes;
 my %slow_index = ();
 my %fast_index = ();
@@ -196,10 +196,11 @@ while (my $dir = shift @dirs) {
                     next;
                }
                next if $stat->mtime < $time;
-               my $fdata = readbug($bug, $initialdir);
+               my $fdata = split_status_fields(readbug($bug, $initialdir));
                $modification_made = 1;
-               addbugtoindex("package", $bug, split /[\s,]+/, $fdata->{"package"});
-               addbugtoindex("tag", $bug, split /[\s,]+/, $fdata->{"keywords"});
+               addbugtoindex("package", $bug, make_list($fdata->{package}));
+               addbugtoindex("tag", $bug, make_list($fdata->{keywords}));
+               addbugtoindex("affects", $bug, make_list($fdata->{"affects"}));
                addbugtoindex('submitter-email', $bug,
                              map {lc($_->address)} getparsedaddrs($fdata->{originator}));
                addbugtoindex("severity", $bug, $fdata->{"severity"});