From e7c68cd940f8ab1a8de85f6685367cfb7eb6378f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 1 Feb 2015 10:19:31 +0100 Subject: [PATCH] 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. --- tools/mkcountries-geonames | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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"; -- 2.30.0