]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Bugs.pm
merge changes from don
[debbugs.git] / Debbugs / Bugs.pm
index 20e2fb76ceef7f9b1d03b0e98c9479f6e0fea10e..36bcc7b487e6c6c1c3d84de20c66aff68445b104 100644 (file)
@@ -92,6 +92,8 @@ for limited regular expressions, and/or more complex expressions.
 
 =item correspondent -- address of someone who sent mail to the log
 
+=item affects -- bugs which affect this package
+
 =item dist -- distribution (I don't know about this one yet)
 
 =item bugs -- list of bugs to search within
@@ -182,6 +184,9 @@ sub get_bugs{
                                          correspondent => {type => SCALAR|ARRAYREF,
                                                            optional => 1,
                                                           },
+                                         affects   => {type => SCALAR|ARRAYREF,
+                                                       optional => 1,
+                                                      },
                                          function  => {type => CODEREF,
                                                        optional => 1,
                                                       },
@@ -304,14 +309,16 @@ sub newest_bug {
 
 Allows filtering bugs on commonly used criteria
 
+
+
 =cut
 
 sub bug_filter {
      my %param = validate_with(params => \@_,
-                              spec   => {bug => {type  => SCALAR,
-                                                 regex => qr/^\d+$/,
-                                                },
-                                         status => {type => HASHREF,
+                              spec   => {bug    => {type => ARRAYREF|SCALAR,
+                                                    optional => 1,
+                                                   },
+                                         status => {type => HASHREF|ARRAYREF,
                                                     optional => 1,
                                                    },
                                          seen_merged => {type => HASHREF,
@@ -339,6 +346,9 @@ sub bug_filter {
         not defined $param{seen_merged}) {
          croak "repeat_merged false requires seen_merged to be passed";
      }
+     if (not exists $param{bug} and not exists $param{status}) {
+        croak "one of bug or status must be passed";
+     }
 
      if (not exists $param{status}) {
          my $location = getbuglocation($param{bug}, 'summary');
@@ -410,6 +420,9 @@ sub get_bugs_by_idx{
                                          correspondent => {type => SCALAR|ARRAYREF,
                                                            optional => 1,
                                                           },
+                                         affects => {type => SCALAR|ARRAYREF,
+                                                     optional => 1,
+                                                    },
                                          usertags  => {type => HASHREF,
                                                        optional => 1,
                                                       },
@@ -512,6 +525,9 @@ sub get_bugs_flatfile{
                                          correspondent => {type => SCALAR|ARRAYREF,
                                                            optional => 1,
                                                           },
+                                         affects   => {type => SCALAR|ARRAYREF,
+                                                       optional => 1,
+                                                      },
 # not yet supported
 #                                        dist      => {type => SCALAR|ARRAYREF,
 #                                                      optional => 1,
@@ -561,9 +577,10 @@ sub get_bugs_flatfile{
          $bugs{$_} = 1 for make_list($param{bugs});
          $grep_bugs = 1;
      }
-     if (exists $param{owner} or exists $param{correspondent}) {
+     if (exists $param{owner} or exists $param{correspondent} or exists $param{affects}) {
          $bugs{$_} = 1 for get_bugs_by_idx(exists $param{correspondent}?(correspondent => $param{correspondent}):(),
                                            exists $param{owner}?(owner => $param{owner}):(),
+                                           exists $param{affects}?(affects => $param{affects}):(),
                                           );
          $grep_bugs = 1;
      }
@@ -693,6 +710,7 @@ my %field_match = (
     },
     'severity' => \&__exact_field_match,
     'pending' => \&__exact_field_match,
+    'package' => \&__exact_field_match,
     'originator' => \&__contains_field_match,
     'forwarded' => \&__contains_field_match,
     'owner' => \&__contains_field_match,