]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Add support for affects_distribution_tags
authorDon Armstrong <don@donarmstrong.com>
Thu, 18 Sep 2008 02:55:51 +0000 (19:55 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 18 Sep 2008 02:55:51 +0000 (19:55 -0700)
 * Properly handle the intersection of a set of distributions and the
   tags that are set on that distribution

Debbugs/Config.pm
Debbugs/Status.pm

index 2a34f188089291dc5bbf97e34e76574b35dca787..a212a799754112a1e56af4c64f9efd10ab083f18 100644 (file)
@@ -417,6 +417,25 @@ set_default(\%config,'default_architectures',
            [qw(i386 amd64 arm powerpc sparc alpha)]
           );
 
+=item affects_distribution_tags
+
+List of tags which restrict the buggy state to a set of distributions.
+
+The set of distributions that are buggy is the intersection of the set
+of distributions that would be buggy without reference to these tags
+and the set of these tags that are distributions which are set on a
+bug.
+
+Setting this to [] will remove this feature.
+
+Default: @{$config{distributions}}
+
+=cut
+
+set_default(\%config,'affects_distribution_tags',
+           [@{$config{distributions}}],
+          );
+
 =item removal_unremovable_tags
 
 Bugs which have these tags set cannot be archived
@@ -585,7 +604,10 @@ Default:
 
 set_default(\%config,'severity_display',{critical => "Critical $config{bugs}",
                                         grave    => "Grave $config{bugs}",
+                                        serious  => "Serious $config{bugs}",
+                                        important=> "Important $config{bugs}",
                                         normal   => "Normal $config{bugs}",
+                                        minor    => "Minor $config{bugs}",
                                         wishlist => "Wishlist $config{bugs}",
                                        });
 
index aefeb9cbbfa1e629c30233158b2f9ffc56013222..69374eea2d6f725205f0012f8fd77e28439fc0bf 100644 (file)
@@ -1069,12 +1069,33 @@ sub bug_presence {
                    }
               }
          } elsif (defined $param{dist}) {
+              my %affects_distribution_tags;
+              @affects_distribution_tags{@{$config{affects_distribution_tags}}} =
+                   (1) x @{$config{affects_distribution_tags}};
+              my $some_distributions_disallowed = 0;
+              my %allowed_distributions;
+              for my $tag (split ' ', ($status->{tags}||'')) {
+                   if (exists $affects_distribution_tags{$tag}) {
+                        $some_distributions_disallowed = 1;
+                        $allowed_distributions{$tag} = 1;
+                   }
+              }
               foreach my $arch (make_list($param{arch})) {
-                   my @versions;
                    for my $package (split /\s*,\s*/, $status{package}) {
+                        my @versions;
                         foreach my $dist (make_list($param{dist})) {
+                             # if some distributions are disallowed,
+                             # and this isn't an allowed
+                             # distribution, then we ignore this
+                             # distribution for the purposees of
+                             # finding versions
+                             if ($some_distributions_disallowed and
+                                 not exists $allowed_distributions{$tag}) {
+                                  next;
+                             }
                              push @versions, getversions($package, $dist, $arch);
                         }
+                        next unless @versions;
                         my @temp = makesourceversions($package,
                                                       $arch,
                                                       @versions