]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Control.pm
Allow the default sendmail options to be specified in the config file;
[debbugs.git] / Debbugs / Control.pm
index 300bfba32aa3a3678a91e9f02ca75cffc3aad436..d994170bb0f24fa6c5f72cd525ebb505556f64a2 100644 (file)
@@ -107,7 +107,7 @@ BEGIN{
 
 use Debbugs::Config qw(:config);
 use Debbugs::Common qw(:lock buglog :misc get_hashname);
-use Debbugs::Status qw(bug_archiveable :read :hook writebug splitpackages split_status_fields);
+use Debbugs::Status qw(bug_archiveable :read :hook writebug splitpackages split_status_fields get_bug_status);
 use Debbugs::CGI qw(html_escape);
 use Debbugs::Log qw(:misc);
 use Debbugs::Recipients qw(:add);
@@ -2799,23 +2799,28 @@ sub __check_limit{
     my $transcript = globify_scalar(exists $param{transcript}?$param{transcript}:undef);
     my $going_to_fail = 0;
     for my $data (@data) {
-       $data = get_bug_status(bug => $data->{bug_num},
-                              status => dclone($data),
-                             );
+       $data = split_status_fields(get_bug_status(bug => $data->{bug_num},
+                                                  status => dclone($data),
+                                                 ));
        for my $field (keys %{$param{limit}}) {
            next unless exists $param{limit}{$field};
            my $match = 0;
-           for my $limit (make_list($param{limit}{$field})) {
+           my @data_fields = make_list($data->{$field});
+LIMIT:     for my $limit (make_list($param{limit}{$field})) {
                if (not ref $limit) {
-                   if ($data->{$field} eq $limit) {
-                       $match = 1;
-                       last;
+                   for my $data_field (@data_fields) {
+                       if ($data_field eq $limit) {
+                           $match = 1;
+                           last LIMIT;
+                       }
                    }
                }
                elsif (ref($limit) eq 'Regexp') {
-                   if ($data->{$field} =~ $limit) {
-                       $match = 1;
-                       last;
+                   for my $data_field (@data_fields) {
+                       if ($data_field =~ $limit) {
+                           $match = 1;
+                           last LIMIT;
+                       }
                    }
                }
                else {
@@ -2824,8 +2829,9 @@ sub __check_limit{
            }
            if (not $match) {
                $going_to_fail = 1;
-               print {$transcript} "$field: '$data->{$field}' does not match at least one of ".
-                   join(', ',map {ref($_)?'(regex)':$_} make_list($param{limit}{$field}))."\n";
+               print {$transcript} qq($field: ).join(', ',map{qq("$_")} make_list($data->{$field})).
+                   "' does not match at least one of ".
+                   join(', ',map {ref($_)?'(regex)':qq("$_")} make_list($param{limit}{$field}))."\n";
            }
        }
     }