The handling of region vs broken mirrors (in state "f") is wrong,
and we might end up with the wrong URLs in foreign regions, like:
| # ./generate_mirror_map| sort -u
| at mirror.alwyzon.net/grml/|at.mirror.anexia.com/grml/
| br grml.c3sl.ufpr.br//
| ch mirror.de.leaseweb.net/grml/|ftp.halifax.rwth-aachen.de/grml/|mirror.23m.com/grml/
| cn mirror.de.leaseweb.net/grml/|ftp.halifax.rwth-aachen.de/grml/|mirror.23m.com/grml/
| de mirror.de.leaseweb.net/grml/|ftp.halifax.rwth-aachen.de/grml/|mirror.23m.com/grml/
| fi mirror.de.leaseweb.net/grml/|ftp.halifax.rwth-aachen.de/grml/|mirror.23m.com/grml/
| gb mirror.bytemark.co.uk/grml/
| hk mirror-hk.koddos.net/grml/
| ir mirror.bardia.tech/grml/
| nl mirror.koddos.net/grml/|mirror.nl.leaseweb.net/grml/
| tw tw1.mirror.blendbyte.net/grml/
| ua grml.ip-connect.info//|grml.ip-connect.vn.ua//
| us mirror.us.leaseweb.net/grml/|mirrors.rit.edu/grml/
Now with the fixed behavior, we get what we're expecting:
| # ./generate_mirror_map| sort -u
| at mirror.alwyzon.net/grml/|at.mirror.anexia.com/grml/
| br grml.c3sl.ufpr.br//
| de mirror.23m.com/grml/|mirror.de.leaseweb.net/grml/|ftp.halifax.rwth-aachen.de/grml/
| gb mirror.bytemark.co.uk/grml/
| hk mirror-hk.koddos.net/grml/
| ir mirror.bardia.tech/grml/
| nl mirror.nl.leaseweb.net/grml/|mirror.koddos.net/grml/
| tw tw1.mirror.blendbyte.net/grml/
| ua grml.ip-connect.info//|grml.ip-connect.vn.ua//
| us mirror.us.leaseweb.net/grml/|mirrors.rit.edu/grml/
$mirror = $state -> { $url } ; # a Mirmon::Mirror object
my ($time, $history) = split('-', $mirror->{state_history});
my $last_state = substr($history,-1,1);
+ next if $last_state eq 'f';
my $region = $mirror->region;
$regions_hash->{$region} = 1;
- next if $last_state eq 'f';
$mirrors->{ $region } ||= [];
$url =~ s/^http:\/\///;
push @{$mirrors->{ $region }}, $url;