From: Mischa POSLAWSKY Date: Sun, 1 Feb 2015 09:19:31 +0000 (+0100) Subject: countries: reference tld if different from iso code X-Git-Tag: v1.6~44 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/e7c68cd940f8ab1a8de85f6685367cfb7eb6378f countries: reference tld if different from iso code Since we have the data, indicate that (currently) GB is .uk and BL and MF use .gp. --- diff --git a/tools/mkcountries-geonames b/tools/mkcountries-geonames index 325379c..91daae7 100755 --- a/tools/mkcountries-geonames +++ b/tools/mkcountries-geonames @@ -52,9 +52,10 @@ my %cc; # map of country code to info array while (<>) { /^#/ and next; # skip comments - my ($iso, $name, $cont) = (split /\t/)[0, 4, 8]; - my $class = "c-\L$cont"; - $cc{ lc $iso } = [ $name, $class ]; + my ($iso, $name, $cont, $tld) = (split /\t/)[0, 4, 8, 9]; + my @info = ($name, "c-\L$cont"); + $info[3] = $tld if $tld =~ s/\A\.// and $tld ne lc $iso; + $cc{ lc $iso } = \@info; } $cc{io}->[2] = "Chagos Islands";