git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca8caa9
)
countries: reference tld if different from iso code
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 1 Feb 2015 09:19:31 +0000
(10:19 +0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 1 Feb 2015 17:34:57 +0000
(18:34 +0100)
Since we have the data, indicate that (currently) GB is .uk and BL and MF use .gp.
tools/mkcountries-geonames
patch
|
blob
|
history
diff --git
a/tools/mkcountries-geonames
b/tools/mkcountries-geonames
index 325379ce7eb8591c4795198175f6a51f6382035b..91daae753722d030e40af9340c1d6221f59377c0 100755
(executable)
--- 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";