Fix region handling of broken mirrors
authorMichael Prokop <mika@grml.org>
Thu, 12 May 2022 10:54:09 +0000 (12:54 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 12 May 2022 10:54:09 +0000 (12:54 +0200)
commita938356fed2ea92abed3ad61138f770133bccc90
tree8e21cfa0d4eb28bdb490e9208f198c2abaf78ac7
parentaf178d1101a704ff8eac7822b92df22c53b66af9
Fix region handling of broken mirrors

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/
bin/generate_mirror_map