Skip to content

Commit

Permalink
Generate mailing list appropriate to Jiscmail
Browse files Browse the repository at this point in the history
Resolves #108.
  • Loading branch information
iay committed Jan 18, 2017
1 parent d9318b3 commit 03ae329
Showing 1 changed file with 4 additions and 43 deletions.
47 changes: 4 additions & 43 deletions build/addresses.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

use Xalan;

#
# Load list addresses.
#
open(LIST, "list.txt") || die "could not open list addresses file";
while (<LIST>) {
chomp; # remove \n
$list{$_} = 1 unless $_ eq '';
}
close LIST;

#
# Load extra addresses.
#
Expand Down Expand Up @@ -53,40 +43,11 @@
}

#
# Similar lower-case hash for the current list.
#
foreach $addr (keys %list) {
$have{lc $addr} = $addr;
}

#
# Cancel the ones that are *in* the mailing list from the wanted
# collection. Whine about (now) unwanted entries in the
# mailing list.
# List all wanted addresses.
#
$first = 1;
foreach $addr (sort keys %have) {
my $a = $have{$addr};
if (defined($wanted{$addr})) {
delete $wanted{$addr};
} else {
if ($first) {
$first = 0;
print "\nDelete unwanted: \n";
}
print "$a\n";
}
}

#
# List the ones that are wanted, but not yet in the list.
#
$first = 1;
foreach $addr (keys %wanted) {
print "--- LIST BEGIN ---\n";
foreach $addr (sort keys %wanted) {
my $a = $wanted{$addr};
if ($first) {
$first = 0;
print "\nAdd wanted: \n";
}
print "$a\n";
}
print "--- LIST END ---\n";

0 comments on commit 03ae329

Please sign in to comment.