From: Don Armstrong Date: Thu, 19 Jun 2008 23:12:39 +0000 (-0700) Subject: * Add removal_unremovable_tags support X-Git-Tag: release/2.6.0~488^2~31 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=02521b424c66db1bcb7d071da99147eb2a49731e * Add removal_unremovable_tags support * Add usertag_dir config variable --- diff --git a/Debbugs/Config.pm b/Debbugs/Config.pm index ed01bc8..34a8257 100644 --- a/Debbugs/Config.pm +++ b/Debbugs/Config.pm @@ -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'); diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index 52e28ed..8ac350b 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -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');