From: Don Armstrong Date: Thu, 18 Sep 2008 02:55:51 +0000 (-0700) Subject: * Add support for affects_distribution_tags X-Git-Tag: release/2.6.0~472^2~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5c6f0551430028f1283e0cef76be004922340150;p=debbugs.git * Add support for affects_distribution_tags * Properly handle the intersection of a set of distributions and the tags that are set on that distribution --- diff --git a/Debbugs/Config.pm b/Debbugs/Config.pm index 2a34f18..a212a79 100644 --- a/Debbugs/Config.pm +++ b/Debbugs/Config.pm @@ -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}", }); diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index aefeb9c..69374ee 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -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