]> git.donarmstrong.com Git - debbugs.git/commitdiff
add fixed and notfixed commands
authorDon Armstrong <don@volo>
Mon, 19 Mar 2007 07:31:43 +0000 (00:31 -0700)
committerDon Armstrong <don@volo>
Mon, 19 Mar 2007 07:31:43 +0000 (00:31 -0700)
Debbugs/Config.pm
Debbugs/Status.pm
scripts/service.in
t/06_mail_handling.t

index 9b2792a2972c8aa44889c38b71f6145de63c8941..68dd507abdfe81916d8c0587e777bcc3c3d146fe 100644 (file)
@@ -348,6 +348,34 @@ set_default(\%config,'removal_default_distribution_tags',
            [qw(unstable testing)]
           );
 
+=item package_name_re
+
+The regex which will match a package name
+
+Default: '[a-z0-9][a-z0-9\.+-]+'
+
+=cut
+
+set_default(\%config,'package_name_re',
+           '[a-z0-9][a-z0-9\.+-]+');
+
+=item package_version_re
+
+The regex which will match a package version
+
+Default: '[A-Za-z0-9:+\.-]+'
+
+=cut
+
+set_default(\%config,'package_version_re',
+           '[A-Za-z0-9:+\.-]+');
+
+
+
+
+
+
+
 set_default(\%config,'default_severity','normal');
 set_default(\%config,'show_severities','critical, grave, normal, minor, wishlist');
 set_default(\%config,'strong_severities',[qw(critical grave)]);
index c78e58559c7eca270504225ac6702d9b99a061ec..22d818345e5ad35432537739fba6e4fff32d91e8 100644 (file)
@@ -48,7 +48,7 @@ BEGIN{
                     read   => [qw(readbug read_bug lockreadbug)],
                     write  => [qw(writebug makestatus unlockwritebug)],
                     versions => [qw(addfoundversions addfixedversions),
-                                 qw(removefoundversions)
+                                 qw(removefoundversions removefixedversions)
                                 ],
                     hook     => [qw(bughook bughook_archive)],
                    );
index e5074d329ad053ae5b2e99f6abdd54bf891f1059..d4e8e98ed6d066bab95db98f659567d0f40a6c1b 100755 (executable)
@@ -11,7 +11,7 @@ use Debbugs::Mail qw(send_mail_message);
 use Debbugs::User;
 use HTML::Entities qw(encode_entities);
 
-use Debbugs::Config qw(:globals);
+use Debbugs::Config qw(:globals :config);
 use Debbugs::CGI qw(html_escape);
 $lib_path = $gLibPath;
 require "$lib_path/errorlib";
@@ -507,7 +507,9 @@ END
                 } while (&getnextbug);
             }
         }
-    } elsif (m/^found\s+\#?(-?\d+)(?:\s+(\d.*))?$/i) {
+    } elsif (m{^found\s+\#?(-?\d+)
+              (?:\s+(?:$config{package_name_re}\/)?
+                   ($config{package_version_re}))?$}ix) {
         $ok++;
         $ref= $1;
         $version= $2;
@@ -560,8 +562,43 @@ END
                 &addmaintainers($data);
                 removefoundversions($data, $data->{package}, $version, 'binary');
             } while (&getnextbug);
-        }
-    } elsif (m/^submitter\s+\#?(-?\d+)\s+\!$/i ? ($newsubmitter=$replyto, 1) :
+       }
+   }
+    elsif (m[^fixed\s+\#?(-?\d+)\s+
+            ((?:$config{package_name_re}\/)?
+                 $config{package_version_re})\s*$]ix) {
+        $ok++;
+        $ref= $1;
+        $version= $2;
+        if (&setbug) {
+            $action=
+                 defined($version) ?
+                      "$gBug marked as fixed in version $version." :
+                           "$gBug reopened.";
+                do {
+                    &addmaintainers($data);
+                    addfixedversions($data, $data->{package}, $version, 'binary');
+              } while (&getnextbug);
+       }
+   }
+    elsif (m[^notfixed\s+\#?(-?\d+)\s+
+            ((?:$config{package_name_re}\/)?
+                 $config{package_version_re})\s*$]ix) {
+        $ok++;
+        $ref= $1;
+        $version= $2;
+        if (&setbug) {
+            $action=
+                 defined($version) ?
+                      "$gBug marked as not fixed in version $version." :
+                           "$gBug reopened.";
+                do {
+                    &addmaintainers($data);
+                    removefixedversions($data, $data->{package}, $version, 'binary');
+              } while (&getnextbug);
+       }
+   }
+    elsif (m/^submitter\s+\#?(-?\d+)\s+\!$/i ? ($newsubmitter=$replyto, 1) :
              m/^submitter\s+\#?(-?\d+)\s+(\S.*\S)$/i ? ($newsubmitter=$2, 1) : 0) {
         $ok++;
         $ref= $1;
index c5be8477c87af4633bc13308c7531dde2b4aec90..01d4bc0d34ad65f1ed258d3897c023148f9220ea 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 31;
+use Test::More tests => 37;
 
 use warnings;
 use strict;
@@ -135,6 +135,16 @@ my @control_commands =
                             status_key => 'found_versions',
                             status_value => [],
                            },
+      'fixed_1.1'        => {command => 'fixed',
+                            value   => '1.1',
+                            status_key => 'fixed_versions',
+                            status_value => ['1.1'],
+                           },
+      'notfixed_1.1'     => {command => 'notfixed',
+                            value   => '1.1',
+                            status_key => 'fixed_versions',
+                            status_value => [],
+                           },
       submitter_foo      => {command => 'submitter',
                             value   => 'foo@bar.com',
                             status_key => 'originator',