]>
git.proxmox.com Git - pve-installer.git/blob - country.pl
8 # see also: http://en.wikipedia.org/wiki/Keyboard_layout
10 # country codes from: /usr/share/zoneinfo/iso3166.tab
11 # timezones from: /usr/share/zoneinfo/zone.tab
12 # keymaps: find /usr/share/keymaps/i386/ -type f -name '*.kmap.gz'
13 # x11 layouts: /usr/share/X11/xkb/rules/xorg.lst
18 open (TMP
, "</usr/share/zoneinfo/iso3166.tab");
19 while (defined ($line = <TMP
>)) {
20 if ($line =~ m/^([A-Z][A-Z])\s+(.*\S)\s*$/) {
21 $country->{lc($1)} = $2;
26 # we need mappings for X11, console, and kvm vnc
28 # LC(-LC)? => [DESC, kvm, console, X11, X11variant]
29 my $keymaps = PVE
::Tools
::kvmkeymaps
();
31 foreach my $km (sort keys %$keymaps) {
32 my ($desc, $kvm, $console, $x11, $x11var) = @{$keymaps->{$km}};
34 if ($km =~m/^([a-z][a-z])-([a-z][a-z])$/i) {
35 defined ($country->{$2}) || die "undefined country code '$2'";
37 defined ($country->{$km}) || die "undefined country code '$km'";
40 $x11var = '' if !defined ($x11var);
41 print "map:$km:$desc:$kvm:$console:$x11:$x11var:\n";
50 'nl' => 'en-us', # most Dutch people us US layout
75 my $mirrors = PVE
::Tools
::debmirrors
();
76 foreach my $cc (keys %$mirrors) {
77 die "undefined country code '$cc'" if !defined ($country->{$cc});
80 foreach my $cc (sort keys %$country) {
81 my $map = $defmap->{$cc} || '';
82 my $mir = $mirrors->{$cc} || '';
83 print "$cc:$country->{$cc}:$map:$mir:\n";