]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Add a distribution alias -> distribution configuration map
authorDon Armstrong <don@donarmstrong.com>
Sat, 14 Jul 2007 02:52:08 +0000 (19:52 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sat, 14 Jul 2007 02:52:08 +0000 (19:52 -0700)
 * Add a separate set of default distribution tags for strong severities
 * If any distribution tags are set, do not apply the default distribution set
 * Use the strong severity default distribution set in archival of
   strong severity bugs.

Debbugs/Config.pm
Debbugs/Status.pm

index 7b2fc579a3d5cc72ed6c60bb63b3458211a5518a..fe07b6403e09ed88575a4d03eff61b23ecf7ecac 100644 (file)
@@ -61,7 +61,9 @@ BEGIN {
                                 qw($gSendmail $gLibPath $gSpamScan @gExcludeFromControl),
                                 qw(%gSeverityDisplay @gTags @gSeverityList @gStrongSeverities),
                                 qw(%gSearchEstraier),
+                                qw(%gDistributionAliases),
                                 qw(@gPostProcessall @gRemovalDefaultDistributionTags @gRemovalDistributionTags @gRemovalArchitectures),
+                                qw(@gRemovalStrongSeverityDefaultDistributionTags),
                                ],
                     text     => [qw($gBadEmailPrefix $gHTMLTail $gHTMLExpireNote),
                                 ],
@@ -335,15 +337,50 @@ Default: 1
 
 set_default(\%config,'save_old_bugs',1);
 
+=item distribution_aliases
+
+Map of distribution aliases to the distribution name
+
+Default:
+         {experimental => 'experimental',
+         unstable     => 'unstable',
+         testing      => 'testing',
+         stable       => 'stable',
+         oldstable    => 'oldstable',
+         sid          => 'unstable',
+         lenny        => 'testing',
+         etch         => 'stable',
+         sarge        => 'oldstable',
+        }
+
+=cut
+
+set_default(\%config,'distribution_aliases',
+           {experimental => 'experimental',
+            unstable     => 'unstable',
+            testing      => 'testing',
+            stable       => 'stable',
+            oldstable    => 'oldstable',
+            sid          => 'unstable',
+            lenny        => 'testing',
+            etch         => 'stable',
+            sarge        => 'oldstable',
+           },
+          );
+
+
+
 =item distributions
 
 List of valid distributions
 
-Default: qw(experimental unstable testing stable oldstable);
+Default: The values of the distribution aliases map.
 
 =cut
 
-set_default(\%config,'distributions',[qw(experimental unstable testing stable oldstable)]);
+my %_distributions_default;
+@_distributions_default{values %{$config{distribution_aliases}}} = values %{$config{distribution_aliases}};
+set_default(\%config,'distributions',[keys %_distributions_default]);
 
 =item removal_distribution_tags
 
@@ -369,6 +406,20 @@ set_default(\%config,'removal_default_distribution_tags',
            [qw(unstable testing)]
           );
 
+=item removal_strong_severity_default_distribution_tags
+
+For removal/archival purposes, all bugs with strong severity are
+assumed to have these tags set.
+
+Default: qw(unstable testing stable);
+
+=cut
+
+set_default(\%config,'removal_strong_severity_default_distribution_tags',
+           [qw(unstable testing stable)]
+          );
+
+
 =item removal_architectures
 
 For removal/archival purposes, these architectures are consulted if
index 8349036ea56fa38f8c36d1eac8a74f88cd418e7e..b6f1375f4536804cecf7fcb670328f1b39ac114c 100644 (file)
@@ -649,6 +649,10 @@ sub bug_archiveable{
      # tags set, we assume a default set, otherwise we use the tags the bug
      # has set.
 
+     # In cases where we are assuming a default set, if the severity
+     # is strong, we use the strong severity default; otherwise, we
+     # use the normal default.
+
      # There must be fixed_versions for us to look at the versioning
      # information
      my $min_fixed_time = time;
@@ -658,11 +662,20 @@ sub bug_archiveable{
          @dist_tags{@{$config{removal_distribution_tags}}} =
               (1) x @{$config{removal_distribution_tags}};
          my %dists;
-         @dists{@{$config{removal_default_distribution_tags}}} =
-              (1) x @{$config{removal_default_distribution_tags}};
          for my $tag (split ' ', ($status->{tags}||'')) {
-              next unless $dist_tags{$tag};
-              $dists{$tag} = 1;
+              next unless exists $config{distribution_aliases}{$tag};
+              next unless $dist_tags{$config{distribution_aliases}{$tag}};
+              $dists{$config{distribution_aliases}{$tag}} = 1;
+         }
+         if (not keys %dists) {
+              if (isstrongseverity($status->{severity})) {
+                   @dists{@{$config{removal_strong_severity_default_distribution_tags}}} =
+                        (1) x @{$config{removal_strong_severity_default_distribution_tags}};
+              }
+              else {
+                   @dists{@{$config{removal_default_distribution_tags}}} =
+                        (1) x @{$config{removal_default_distribution_tags}};
+              }
          }
          my %source_versions;
          my @sourceversions = get_versions(package => $status->{package},