]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Add removal_unremovable_tags support
authorDon Armstrong <don@donarmstrong.com>
Thu, 19 Jun 2008 23:12:39 +0000 (16:12 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 19 Jun 2008 23:12:39 +0000 (16:12 -0700)
 * Add usertag_dir config variable

Debbugs/Config.pm
Debbugs/Status.pm

index ed01bc8a31c17288e86a878820230d7fafc4a9ec..34a825791fbbe59f7db8ae24e0fbcd45e28e7c45 100644 (file)
@@ -401,6 +401,18 @@ set_default(\%config,'default_architectures',
            [qw(i386 amd64 arm powerpc sparc alpha)]
           );
 
+=item removal_unremovable_tags
+
+Bugs which have these tags set cannot be archived
+
+Default: []
+
+=cut
+
+set_default(\%config,'removal_unremovable_tags',
+           [],
+          );
+
 =item removal_distribution_tags
 
 Tags which specifiy distributions to check
@@ -611,6 +623,16 @@ set_default(\%config,'bounce_froms','^mailer|^da?emon|^post.*mast|^root|^wpuser|
 
 set_default(\%config,'config_dir',dirname(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config'));
 set_default(\%config,'spool_dir','/var/lib/debbugs/spool');
+
+=item usertag_dir
+
+Directory which contains the usertags
+
+Default: $config{spool_dir}/user
+
+=cut
+
+set_default(\%config,'usertag_dir',$config{spool_dir}.'/user');
 set_default(\%config,'incoming_dir','incoming');
 set_default(\%config,'web_dir','/var/lib/debbugs/www');
 set_default(\%config,'doc_dir','/var/lib/debbugs/www/txt');
index 52e28edf9573f22ad12d6a126ff0a8a84d8e0cad..8ac350b62255d5a615729089a9b404cdf4b124eb 100644 (file)
@@ -631,6 +631,16 @@ sub bug_archiveable{
          print STDERR "Cannot archive $param{bug} because it is not done\n" if $DEBUG;
          return $cannot_archive
      }
+     # Check to make sure that the bug has none of the unremovable tags set
+     if (@{$config{removal_unremovable_tags}}) {
+         for my $tag (split ' ', ($status->{tags}||'')) {
+              if (grep {$tag eq $_} @{$config{removal_unremovable_tags}}) {
+                   print STDERR "Cannot archive $param{bug} because it has an unremovable tag '$tag'\n" if $DEBUG;
+                   return $cannot_archive;
+              }
+         }
+     }
+
      # If we just are checking if the bug can be archived, we'll not even bother
      # checking the versioning information if the bug has been -done for less than 28 days.
      my $log_file = getbugcomponent($param{bug},'log');