summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-06-22 21:03:19 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-06-22 21:03:19 +0200
commit1999263c21ff9b5321ecc7ed268822e4d7be74e5 (patch)
tree76e11773fbac5056ae484dd66bd0317d63ce9082
parenta23a0874d15482df8fe89b3ac86d39eac2e7b705 (diff)
downloadarch-mirror-tools-1999263c21ff9b5321ecc7ed268822e4d7be74e5.tar.gz
arch-mirror-tools-1999263c21ff9b5321ecc7ed268822e4d7be74e5.tar.xz
Deduplicate protocol list in mirror mails
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xbin/generate-mirror-mail.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/generate-mirror-mail.pl b/bin/generate-mirror-mail.pl
index c6e8a19..175b8b2 100755
--- a/bin/generate-mirror-mail.pl
+++ b/bin/generate-mirror-mail.pl
@@ -8,6 +8,7 @@ use Date::Parse;
use File::Basename;
use HTTP::Cookies;
use JSON;
+use List::Util qw(uniq);
use Text::Template;
use Try::Tiny;
use WWW::Mechanize;
@@ -197,7 +198,7 @@ while (<STDIN>) {
mail_from_name => $Config->{misc}->{name} // die "misc.name not set in config",
);
- my @protocols = map {${$_}{protocol}} @connection_failed;
+ my @protocols = uniq map {${$_}{protocol}} @connection_failed;
my @active_urls = grep { $_->{active} } @{$json->{urls}};
if (scalar(@protocols) != scalar(@active_urls)) {
$values{connection_failed}->{protocols} = \@protocols;