summaryrefslogtreecommitdiffstats
path: root/contrib/sendbugmail.pl
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-06-05 14:39:19 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2013-06-05 14:39:19 +0200
commite4aa1e72aed102d06d13bfe95a96df4c15ecd068 (patch)
treeca282b9e969fae27b3e49c8915a726bc0a01178b /contrib/sendbugmail.pl
parent9da412006c554d22865913d05b111cf01408e346 (diff)
downloadbugzilla-e4aa1e72aed102d06d13bfe95a96df4c15ecd068.tar.gz
bugzilla-e4aa1e72aed102d06d13bfe95a96df4c15ecd068.tar.xz
Bug 874944: Do not display the Excluded list when sending bugmails
r=dkl a=LpSolit
Diffstat (limited to 'contrib/sendbugmail.pl')
-rwxr-xr-xcontrib/sendbugmail.pl31
1 files changed, 11 insertions, 20 deletions
diff --git a/contrib/sendbugmail.pl b/contrib/sendbugmail.pl
index c015810b0..da0eafd30 100755
--- a/contrib/sendbugmail.pl
+++ b/contrib/sendbugmail.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -wT
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -6,6 +6,8 @@
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
+use 5.10.1;
+use strict;
use lib qw(. lib);
use Bugzilla;
@@ -16,7 +18,7 @@ use Bugzilla::User;
my $dbh = Bugzilla->dbh;
sub usage {
- print STDERR "Usage: $0 bug_id user_email\n";
+ say STDERR "Usage: $0 bug_id user_email";
exit;
}
@@ -30,7 +32,7 @@ my $changer = $ARGV[1];
# Validate the bug number.
if (!($bugnum =~ /^(\d+)$/)) {
- print STDERR "Bug number \"$bugnum\" not numeric.\n";
+ say STDERR "Bug number \"$bugnum\" not numeric.";
usage();
}
@@ -40,19 +42,19 @@ my ($id) = $dbh->selectrow_array("SELECT bug_id FROM bugs WHERE bug_id = ?",
undef, $bugnum);
if (!$id) {
- print STDERR "Bug number $bugnum does not exist.\n";
+ say STDERR "Bug number $bugnum does not exist.";
usage();
}
# Validate the changer address.
my $match = Bugzilla->params->{'emailregexp'};
if ($changer !~ /$match/) {
- print STDERR "Changer \"$changer\" doesn't match email regular expression.\n";
+ say STDERR "Changer \"$changer\" doesn't match email regular expression.";
usage();
}
my $changer_user = new Bugzilla::User({ name => $changer });
unless ($changer_user) {
- print STDERR "\"$changer\" is not a valid user.\n";
+ say STDERR "\"$changer\" is not a valid user.";
usage();
}
@@ -61,26 +63,15 @@ my $outputref = Bugzilla::BugMail::Send($bugnum, {'changer' => $changer_user });
# Report the results.
my $sent = scalar(@{$outputref->{sent}});
-my $excluded = scalar(@{$outputref->{excluded}});
if ($sent) {
- print "email sent to $sent recipients:\n";
+ say "email sent to $sent recipients:";
} else {
- print "No email sent.\n";
+ say "No email sent.";
}
foreach my $sent (@{$outputref->{sent}}) {
- print " $sent\n";
-}
-
-if ($excluded) {
- print "$excluded recipients excluded:\n";
-} else {
- print "No recipients excluded.\n";
-}
-
-foreach my $excluded (@{$outputref->{excluded}}) {
- print " $excluded\n";
+ say " $sent";
}
# This document is copyright (C) 2004 Perforce Software, Inc. All rights