summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-06-11 10:06:51 +0200
committerByron Jones <bjones@mozilla.com>2013-06-11 10:06:51 +0200
commitc42a6df0fd079651add3dfd26c44353d44fe5ceb (patch)
tree69c69908d250596c54f40b7f66d128e05b76e1ab /contrib
parent5083550e5f5b09d43bfc7bad4ae060d5a1c80beb (diff)
downloadbugzilla-c42a6df0fd079651add3dfd26c44353d44fe5ceb.tar.gz
bugzilla-c42a6df0fd079651add3dfd26c44353d44fe5ceb.tar.xz
Bug 881348: Do not display the Excluded list when sending bugmails
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/sendbugmail.pl31
-rwxr-xr-xcontrib/sendunsentbugmail.pl29
2 files changed, 22 insertions, 38 deletions
diff --git a/contrib/sendbugmail.pl b/contrib/sendbugmail.pl
index 51de9407d..d0c7d63b7 100755
--- a/contrib/sendbugmail.pl
+++ b/contrib/sendbugmail.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -wT
#
# sendbugmail.pl
#
@@ -12,6 +12,8 @@
#
# Usage: perl -T contrib/sendbugmail.pl bug_id user_email
+use 5.10.1;
+use strict;
use lib qw(. lib);
use Bugzilla;
@@ -22,7 +24,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;
}
@@ -36,7 +38,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();
}
@@ -46,19 +48,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();
}
@@ -67,26 +69,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
diff --git a/contrib/sendunsentbugmail.pl b/contrib/sendunsentbugmail.pl
index 6ddbd2e4c..7771cfeff 100755
--- a/contrib/sendunsentbugmail.pl
+++ b/contrib/sendunsentbugmail.pl
@@ -21,8 +21,8 @@
# Contributor(s): Dave Miller <justdave@bugzilla.org>
# Myk Melez <myk@mozilla.org>
+use 5.10.1;
use strict;
-
use lib qw(. lib);
use Bugzilla;
@@ -40,28 +40,21 @@ my $list = $dbh->selectcol_arrayref(
' ORDER BY bug_id');
if (scalar(@$list) > 0) {
- print "OK, now attempting to send unsent mail\n";
- print scalar(@$list) . " bugs found with possibly unsent mail.\n\n";
+ say "OK, now attempting to send unsent mail";
+ say scalar(@$list) . " bugs found with possibly unsent mail.\n";
foreach my $bugid (@$list) {
my $start_time = time;
- print "Sending mail for bug $bugid...\n";
+ say "Sending mail for bug $bugid...";
my $outputref = Bugzilla::BugMail::Send($bugid);
if ($ARGV[0] && $ARGV[0] eq "--report") {
- print "Mail sent to:\n";
- foreach (sort @{$outputref->{sent}}) {
- print $_ . "\n";
- }
-
- print "Excluded:\n";
- foreach (sort @{$outputref->{excluded}}) {
- print $_ . "\n";
- }
+ say "Mail sent to:";
+ say $_ foreach (sort @{$outputref->{sent}});
}
else {
- my ($sent, $excluded) = (scalar(@{$outputref->{sent}}),scalar(@{$outputref->{excluded}}));
- print "$sent mails sent, $excluded people excluded.\n";
- print "Took " . (time - $start_time) . " seconds.\n\n";
- }
+ my $sent = scalar @{$outputref->{sent}};
+ say "$sent mails sent.";
+ say "Took " . (time - $start_time) . " seconds.\n";
+ }
}
- print "Unsent mail has been sent.\n";
+ say "Unsent mail has been sent.";
}