summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/any.pm58
2 files changed, 60 insertions, 0 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 5472abb2e..c25d17be4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,4 +1,6 @@
- enable to skip keyboard step with keyboard option
+- enable to enable other media
+ (such as 'nonfree', 'tainted' which are disabled by default)
Version 14.52 - 4 December 2012
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index d73d3ed44..12142ed03 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -309,6 +309,62 @@ sub load_rate_files {
defined $o->{compssUsers} or die "Can't read compssUsers.pl file, aborting installation\n";
}
+sub _core_medium() { N("Core Release") }
+
+sub _tainted_medium() { N("Tainted Release") }
+
+sub _nonfree_medium() { N("Nonfree Release") }
+
+sub media_screen {
+ my ($o) = @_;
+
+ my $urpm = $o->{packages};
+ my %descriptions = (
+ 'Core Release' => N("\"%s\" contains the various pieces of the systems and its applications", _core_medium()),
+ 'Nonfree Release' => N("\"%s\" contains non free software.\n", _nonfree_medium()) .
+ N("It also contains firmwares needed for certain devices to operate (eg: some ATI/AMD graphic cards, some network cards, some RAID cards, ..."),
+ 'Tainted Release' => N("\"%s\" contains software that can not be distributed in every country due to software patents.", _tainted_medium()) .
+ N("It also contains software from \"%s\" rebuild with additional capabilities.", _core_medium()),
+ );
+
+ $o->ask_from_({ messages => join("\n",
+ N("Media Choice"),
+ N("Here you can enable more media if you want."),
+ ),
+ focus_first => sub { 1 } }, [
+ map {
+ my $medium = $_;
+ $medium->{temp_enabled} = !$medium->{ignore};
+ +{
+ val => \$medium->{temp_enabled}, type => 'bool', text => $medium->{name},
+ # 'Core Release' cannot be unselected:
+ disabled => sub { $medium->{name} eq 'Core Release' },
+ format => sub { $descriptions{$_[0]} || translate(%descriptions) },
+ };
+ } @{$urpm->{media}},
+ ]);
+
+
+ # is there some media to enable?
+ my $todo;
+ foreach my $medium (@{$urpm->{media}}) {
+ if ($medium->{temp_enabled} == $medium->{ignore}) {
+ $medium->{ignore} = !$medium->{temp_enabled};
+ if (!$medium->{ignore}) {
+ delete $medium->{ignore};
+ log::l("Medium '$medium->{name}' needs to be updated to be usable");
+ urpm::media::select_media($urpm, $medium->{name});
+ $todo = 1;
+ }
+ }
+ delete $medium->{temp_enabled};
+ }
+ return if !$todo;
+ urpm::media::update_media($urpm, allow_failures => 1, nolock => 1, noclean => 1,
+ callback => \&urpm::download::sync_logger
+ );
+}
+
sub setPackages {
my ($o) = @_;
@@ -335,6 +391,8 @@ sub setPackages {
install::pkgs::popup_errors();
}
+ media_screen($o);
+
# actually read synthesis now we have all the ones we want:
require urpm::media;
urpm::media::configure($urpm);
='n235' href='#n235'>235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
package keyboard; # $Id$

use diagnostics;
use strict;

#-######################################################################################
#- misc imports
#-######################################################################################
use common;
use detect_devices;
use run_program;
use log;
use c;


#-######################################################################################
#- Globals
#-######################################################################################
my $KMAP_MAGIC = 0x8B39C07F;

#- a best guess of the keyboard layout, based on the choosen locale
#- beware only the first 5 characters of the locale are used
my %lang2keyboard =
(
  'af' => 'us_intl',
#-'ar' => 'ar:80 ar_d:70 ar_azerty:60 ar_azerty_d:50',
  'az' => 'az:80 tr_q:10 us_intl:5',
  'be' => 'by:80 ru:50 ru_yawerty:40',
  'bg' => 'bg_phonetic:60 bg:50',
  'bn' => 'ben:80 dev:20 us_intl:5',
  'br' => 'fr:90',
  'bs' => 'bs:90',
  'ca' => 'es:89 fr:15',
  'cs' => 'cz_qwerty:70 cz:50',
  'cy' => 'uk:90',
  'da' => 'dk:90',
  'de' => 'de_nodeadkeys:70 de:50',
'de_AT'=> 'de_nodeadkeys:70 de:50',
'de_BE'=> 'be:70 de_nodeadkeys:60 de:50',
'de_CH'=> 'ch_de:70 ch_fr:25 de_nodeadkeys:20 de:15',
'de_DE'=> 'de_nodeadkeys:70 de:50', 
'de_LU'=> 'de_nodeadkeys:70 de:50 fr:40 be:35', 
  'el' => 'gr:90',
  'en' => 'us:90 us_intl:50',
'en_US'=> 'us:90 us_intl:50',
'en_GB'=> 'uk:89 us:60 us_intl:50',
'en_IE'=> 'uk:89 us:60 us_intl:50',
  'eo' => 'us_intl:89 dvorak:20',
  'es' => 'es:85 la:80 us_intl:50',
'es@tr'=> 'es:85 la:80 us_intl:50',
'es_AR'=> 'la:80 us_intl:50 es:20',
'es_ES'=> 'es:90',
'es_MX'=> 'la:80 us_intl:50 es:20',
  'et' => 'ee:90',
  'eu' => 'es:89 fr:15',
  'fa' => 'ir:90',
  'fi' => 'fi:90',
  'fr' => 'fr:90',
'fr_BE'=> 'be:85 fr:5',
'fr_CA'=> 'qc:85 fr:5',
'fr_CH'=> 'ch_fr:70 ch_de:15 fr:10',
'fr_FR'=> 'fr:90',
'fr_LU'=> 'fr:70 de_nodeadkeys:50 de:40 be:35', 
  'ga' => 'uk:90',
  'gd' => 'uk:90',
  'gl' => 'es:90',
  'gu' => 'guj:90',
  'gv' => 'uk:90',
  'he' => 'il:89 il_phonetic:10',
  'hi' => 'dev:90',
  'hr' => 'hr:80 si:50',
  'hu' => 'hu:90',
  'hy' => 'am:80 am_old:10 am_phonetic:5',
  'id' => 'us:90 us_intl:20',
  'is' => 'is:90',
  'iu' => 'iu:90',
  'it' => 'it:90',
'it_CH'=> 'ch_fr:80 ch_de:60 it:50',
'it_IT'=> 'it:90',
  'ja' => 'jp:80 us:50 us_intl:20',
  'ka' => 'ge_la:80 ge_ru:50',
  'kl' => 'dk:80 us_intl:30',
  'ko' => 'kr:80 us:60',
  'kw' => 'uk:90',
  'lo' => 'lao:90',
  'lt' => 'lt:80 lt_new:70 lt_b:60 lt_p:50',
  'lv' => 'lv:80 lt:40 lt_new:30 lt_b:20 lt_p:10 ee:5',
  'mi' => 'us_intl:60 uk:20 us:10',
  'mk' => 'mk:80',
  'mn' => 'mng:75 ru:20 ru_yawerty:5',
  'mr' => 'dev:90',
  'ms' => 'us:90 us_intl:20',
  'mt' => 'mt:55 mt_us:35 us_intl:10',
  'my' => 'mm:90',
  'nb' => 'no:85 dvorak_no:10',
'nl_BE'=> 'be:80 nl:10 us_intl:5',
'nl_NL'=> 'us_intl:80 nl:15 us:10 uk:5',
  'nn' => 'no:85 dvorak_no:10',
  'no' => 'no:85 dvorak_no:10',
  'oc' => 'fr:90',
  'pa' => 'gur:90',
  'ph' => 'us:90 us_intl:20',
  'pl' => 'pl:80 pl2:60',
  'pp' => 'br:80 la:20 pt:10 us_intl:30',
'pt_BR'=> 'br:80 la:20 pt:10 us_intl:30',
'pt_PT'=> 'pt:80',
  'ro' => 'ro2:80 ro:40 us_intl:10',
  'ru' => 'ru:85 ru_yawerty:80',
'ru_RU'=> 'ru:85 ru_yawerty:80',
'ru_UA'=> 'ua:50 ru:40 ru_yawerty:30',
  'sk' => 'sk_qwerty:80 sk:70',
  'sl' => 'si:80 hr:50',
  'sp' => 'sr:80',
'sp_YU'=> 'sr:80',
  'sq' => 'al:80',
  'sr' => 'yu:80',
'sr_YU'=> 'yu:80',
  'sv' => 'se:85 fi:30 dvorak_se:10',
'sv_FI'=> 'fi:85 sv:20',
'sv_SE'=> 'se:85 fi:20',
  'ta' => 'tscii:80 tml:20',
  'tg' => 'tj:80 ru_yawerty:40',
  'th' => 'th:90',
  'tr' => 'tr_q:85 tr_q:30',
  'tt' => 'ru:50 ru_yawerty:40',
  'uk' => 'ua:85 ru:50 ru_yawerty:40',
  'uz' => 'us:80',
  'vi' => 'vn:80 us:60 us_intl:50',
  'wa' => 'be:85 fr:5',
'zh_CN'=> 'us:60',
'zh_HK'=> 'us:60',
'zh_TW'=> 'us:60',
);

# USB kbd table
# The numeric values are the bCountryCode field (5th byte)  of HID descriptor
my @usb2keyboard =
(
  qw(SKIP ar_SKIP be ca_SKIP qc cz dk fi fr de gr il hu us_intl it jp),
#- 0x10
  qw(kr la nl no ir pl pt ru sk es se ch_de ch_de ch_de tw_SKIP tr_q),
#- 0x20
  qw(uk us yu tr_f),
#- higher codes not attribued as of 2002-02
);

#- key = extension for Xmodmap file, [0] = description of the keyboard,
#- [1] = name for loadkeys, [2] = name for XKB, [3] = "1" if it is
#- a multigroup layout (eg: one with latin/non-latin letters)
my %keyboards = (
arch() =~ /^sparc/ ? (
 "cz" => [ __("Czech (QWERTZ)"), "sunt5-cz-us",	    "cz",    0 ],
 "de" => [ __("German"),         "sunt5-de-latin1", "de",    0 ],
 "dvorak" => [ __("Dvorak"),     "sundvorak",       "dvorak",0 ],
 "es" => [ __("Spanish"),        "sunt5-es",        "es",    0 ],
 "fi" => [ __("Finnish"),        "sunt5-fi-latin1", "fi",    0 ],
 "fr" => [ __("French"),         "sunt5-fr-latin1", "fr",    0 ],
 "no" => [ __("Norwegian"),      "sunt4-no-latin1", "no",    0 ],
 "pl" => [ __("Polish"),         "sun-pl-altgraph", "pl",    0 ],
 "ru" => [ __("Russian"),        "sunt5-ru",        "ru",    1 ],
# TODO: check the console map
 "se" => [ __("Swedish"),        "sunt5-fi-latin1", "se",    0 ],
 "uk" => [ __("UK keyboard"),    "sunt5-uk",        "gb",    0 ],
 "us" => [ __("US keyboard"),    "sunkeymap",       "us",    0 ],
) : (
 "al" => [ __("Albanian"),       "al",              "al",    0 ],
 "am_old" => [ __("Armenian (old)"),"am_old",	    "am(old)", 1 ],
 "am" => [ __("Armenian (typewriter)"),"am-armscii8","am",   1 ],
 "am_phonetic" => [ __("Armenian (phonetic)"),"am_phonetic","am(phonetic)",1 ],
#-"ar_azerty" => [ __("Arabic (AZERTY)"),"ar-8859_6","ar(azerty)",1 ],
#-"ar_azerty_d" => [ __("Arabic (AZERTY, arabic digits)"),"ar-8859_6","ar(azerty_digits)",1 ],
#-"ar" => [ __("Arabic (QWERTY)"),"ar-8859_6",      "ar",    1 ],
#-"ar_d" => [ __("Arabic (QWERTY, arabic digits)"),"ar-8859_6","ar(digits)",1 ],
 "az" => [ __("Azerbaidjani (latin)"),"az",         "az",    0 ],
#"a3" => [ __("Azerbaidjani (cyrillic)"), "az-koi8k","az(cyrillic)",1 ],
 "be" => [ __("Belgian"),        "be2-latin1",      "be",    0 ],
 "ben"=> [ __("Bengali"),        "us",              "ben",   1 ],
"bg_phonetic" => [ __("Bulgarian (phonetic)"),"bg", "bg(phonetic)", 1 ],
 "bg" => [ __("Bulgarian (BDS)"), "bg",             "bg",    1 ],
 "br" => [ __("Brazilian (ABNT-2)"),"br-abnt2",     "br",    0 ],
#- Bosnia and Croatia use the same layout, but people are confused if there
#- isn't an antry for their country
 "bs" => [ __("Bosnian"),	 "croat",           "hr",    0 ],
 "by" => [ __("Belarusian"),      "by-cp1251",      "by",    1 ],
 "ch_de" => [ __("Swiss (German layout)"), "sg-latin1", "de_CH", 0 ],
 "ch_fr" => [ __("Swiss (French layout)"), "fr_CH-latin1", "fr_CH", 0 ],
 "cz" => [ __("Czech (QWERTZ)"), "cz-latin2",       "cz",    0 ],
 "cz_qwerty" => [ __("Czech (QWERTY)"), "cz-lat2", "cz_qwerty", 0 ],
 "de" => [ __("German"),         "de-latin1",       "de",    0 ],
 "de_nodeadkeys" => [ __("German (no dead keys)"), "de-latin1-nodeadkeys", "de(nodeadkeys)", 0 ],
 "dev" => [ __("Devanagari"),     "us",              "dev",   0 ],
 "dk" => [ __("Danish"),         "dk-latin1",       "dk",    0 ],
 "dvorak" => [ __("Dvorak (US)"), "pc-dvorak-latin1", "dvorak", 0 ],
 "dvorak_no" => [ __("Dvorak (Norwegian)"), "no-dvorak", "dvorak(no)", 0 ],
 "dvorak_se" => [ __("Dvorak (Swedish)"), "se-dvorak", "dvorak(se)", 0 ],
 "ee" => [ __("Estonian"),       "ee-latin9",       "ee",    0 ],
 "es" => [ __("Spanish"),        "es-latin1",       "es",    0 ],
 "fi" => [ __("Finnish"),        "fi-latin1",       "fi",    0 ],
 "fr" => [ __("French"),         "fr-latin1",       "fr",    0 ],
 "ge_ru"=>[__("Georgian (\"Russian\" layout)"),"ge_ru-georgian_academy","ge_ru",1],
 "ge_la"=>[__("Georgian (\"Latin\" layout)"),"ge_la-georgian_academy","ge_la",1],
 "gr" => [ __("Greek"),          "gr-8859_7",       "el",    1 ],
 "guj"=> [ __("Gujarati"),       "us",              "guj",   1 ],
 "gur"=> [ __("Gurmukhi"),       "us",              "gur",   1 ],
 "hu" => [ __("Hungarian"),      "hu-latin2",       "hu",    0 ],
 "hr" => [ __("Croatian"),	 "croat",           "hr",    0 ],
 "il" => [ __("Israeli"),        "il-8859_8",       "il",    1 ],
 "il_phonetic" => [ __("Israeli (Phonetic)"), "hebrew", "il_phonetic", 1 ],
 "ir" => [ __("Iranian"),        "ir-isiri_3342",   "ir",    1 ],
 "is" => [ __("Icelandic"),      "is-latin1",       "is",    0 ],
 "it" => [ __("Italian"),        "it-latin1",       "it",    0 ],
 "iu" => [ __("Inuktitut"),      "us",              "iu",    1 ],
 "jp" => [ __("Japanese 106 keys"), "jp106",        "jp",    1 ],
#There is no XKB korean file yet; but using xmodmap one disables
# some functioanlity; "us" used for XKB until this is fixed
 "kr" => [ __("Korean keyboard"), "us",             "us",    1 ],
 "la" => [ __("Latin American"), "la-latin1",       "la",    0 ],
 "lao"=> [ __("Laotian"),	 "us",	            "lao",   1 ], 
 "lt" => [ __("Lithuanian AZERTY (old)"), "lt-latin7", "lt_a", 0 ],
#- TODO: write a console kbd map for lt_new
 "lt_new" => [ __("Lithuanian AZERTY (new)"), "lt-latin7", "lt_std", 0 ],
 "lt_b" => [ __("Lithuanian \"number row\" QWERTY"), "ltb-latin7", "lt", 0 ],
 "lt_p" => [ __("Lithuanian \"phonetic\" QWERTY"), "ltp-latin7", "lt_p", 0 ],
 "lv" => [ __("Latvian"),	 "lv-latin7",       "lv",    0 ],
 "mk" => [ __("Macedonian"),	 "mk",              "mk",    1 ],
 "mm" => [ __("Myanmar (Burmese)"),"us",            "mm",    1 ],
 "mng"=> [ __("Mongolian (cyrillic)"),"us",         "mng",   1 ],
 "mt" => [ __("Maltese (UK)"),   "uk",              "mt",    0 ],
 "mt_us" => [ __("Maltese (US)"),"us",              "mt_us", 0 ],
 "nl" => [ __("Dutch"),          "nl-latin1",       "nl",    0 ],
 "no" => [ __("Norwegian"),      "no-latin1",       "no",    0 ],
 "pl" => [ __("Polish (qwerty layout)"), "pl",      "pl",    0 ],
 "pl2" => [ __("Polish (qwertz layout)"), "pl-latin2", "pl2", 0 ],
 "pt" => [ __("Portuguese"),     "pt-latin1",       "pt",    0 ],
 "qc" => [ __("Canadian (Quebec)"), "qc-latin1", "ca_enhanced", 0 ],
#- TODO: write a console kbd map for ro2
 "ro2" => [ __("Romanian (qwertz)"), "ro2",         "ro2",   0 ],
 "ro" => [ __("Romanian (qwerty)"), "ro",           "ro",    0 ],
 "ru" => [ __("Russian"),        "ru4",             "ru(winkeys)", 1 ],
 "ru_yawerty" => [ __("Russian (Yawerty)"), "ru-yawerty", "ru_yawerty", 1 ],
 "se" => [ __("Swedish"),        "se-latin1",       "se",    0 ],
 "si" => [ __("Slovenian"),      "slovene",         "si",    0 ],
 "sk" => [ __("Slovakian (QWERTZ)"), "sk-qwertz",   "sk",    0 ],
 "sk_qwerty" => [ __("Slovakian (QWERTY)"), "sk-qwerty", "sk_qwerty", 0 ],
# TODO: console map
 "sr" => [ __("Serbian (cyrillic)"), "sr",          "sr",    0 ],
# no console kbd that I'm aware of
 "tml" => [ __("Tamil (Unicode)"), "us",            "tml",   1 ],
 "tscii" => [ __("Tamil (TSCII)"), "us",            "tscii", 1 ],
 "th" => [ __("Thai keyboard"),  "th",              "th",    1 ],
# TODO: console map
 "tj" => [ __("Tajik keyboard"), "ru4",             "tj",    1 ],
 "tr_f" => [ __("Turkish (traditional \"F\" model)"), "trf", "tr_f", 0 ],
 "tr_q" => [ __("Turkish (modern \"Q\" model)"), "tr_q-latin5", "tr", 0 ],
#-"tw => [ __("Chineses bopomofo"), "tw",           "tw",    1 ],
 "ua" => [ __("Ukrainian"),      "ua",              "ua",    1 ],
 "uk" => [ __("UK keyboard"),    "uk",              "gb",    0 ],
 "us" => [ __("US keyboard"),    "us",              "us",    0 ],
 "us_intl" => [ __("US keyboard (international)"), "us-latin1", "us_intl", 0 ],
 "vn" => [ __("Vietnamese \"numeric row\" QWERTY"),"vn-tcvn", "vn(toggle)", 0 ], 
 "yu" => [ __("Yugoslavian (latin)"), "sr",         "yu",    0 ],
),
);

#- list of  possible choices for the key combinations to toggle XKB groups
#- (eg in X86Config file: XkbOptions "grp:toggle")
my %grp_toggles = (
    toggle => _("Right Alt key"),
    shift_toggle => _("Both Shift keys simultaneously"),
    ctrl_shift_toggle => _("Control and Shift keys simultaneously"),
    caps_toggle => _("CapsLock key"),
    ctrl_alt_toggle => _("Ctrl and Alt keys simultaneously"),
    alt_shift_toggle => _("Alt and Shift keys simultaneously"),
    menu_toggle => _("\"Menu\" key"),
    lwin_toggle => _("Left \"Windows\" key"),
    rwin_toggle => _("Right \"Windows\" key"),
);


#-######################################################################################
#- Functions
#-######################################################################################
sub KEYBOARDs { keys %keyboards }
sub KEYBOARD2text { $keyboards{$_[0]} && $keyboards{$_[0]}[0] }