From 597f8841cbe80679e58f82a35b6293c058c55f4c Mon Sep 17 00:00:00 2001 From: Reinhard Kotucha Date: Thu, 13 Mar 2008 23:28:54 +0000 Subject: installer: load system dependent stuff only if needed. git-svn-id: svn://tug.org/texlive/trunk@6957 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl.pl | 36 ++++++--------------------- Master/tlpkg/installer/install-menu-perltk.pl | 23 +++++++++++++++++ 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 7124a012f91..4835aaffb1a 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -35,7 +35,6 @@ BEGIN { # Perl executable. if ($^O=~/^MSWin(32|64)$/i) { - #$ENV{'PERL5LIB'}=undef; @INC="$::installerdir/tlpkg/installer/perllib"; } unshift (@INC, "$::installerdir/tlpkg"); @@ -49,34 +48,12 @@ use TeXLive::TLUtils qw(initialize_installer media platform platform_desc use TeXLive::TLPOBJ; use TeXLive::TLPDB; use TeXLive::TLConfig qw($DefaultContainerExtension $InfraLocation); -use TeXLive::TLWinGoo; -use Getopt::Long; -$Getopt::Long::autoabbrev=0; -use utf8; -no utf8; -# default language -$::lang = "en"; -if ($^O =~ /^MSWin(32|64)$/i) { - # trying to deduce automatically the country code - my $foo = TeXLive::TLWinGoo::reg_country(); - if ($foo) { - $::lang = $foo; - } else { - tllog($::LOG_DEBUG, "Didn't get any usuful code from reg_country: $foo...\n"); - } -} else { - # we load POSIX and locale stuff - require POSIX; - import POSIX qw/locale_h/; - # now we try to deduce $::lang - my $loc = setlocale(&POSIX::LC_CTYPE); - my ($lang,$area,$codeset); - if ($loc =~ m/^([^_.]*)(_([^.]*))?(\.([^@]*))?(@.*)?$/) { - $lang = defined($1)?$1:""; - } - $::lang = $lang if ($lang); +if (win32) { + require TeXLive::TLWinGoo; } +use Getopt::Long; +$Getopt::Long::autoabbrev=0; use strict; @@ -154,6 +131,9 @@ my $opt_arch = 0; $::netarchive = "tlpkg"; $::diskarchive = "archive"; +# default language for GUI installer +$::lang = "en"; + GetOptions("media=s" => \$opt_media, "profile=s"=> \$opt_profile, "no-cls", @@ -167,7 +147,7 @@ GetOptions("media=s" => \$opt_media, "ddd" => \$opt_dddebug, "q" => \$opt_quiet, "qq" => \$opt_qquiet, - "url=s" => \$opt_url ) or die("No pod doc till now!"); + "url=s" => \$opt_url ) or die("No pod doc till now!"); if ($opt_quiet) { $::LOGLEVELTERMINAL = $::LOG_ZERO; diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index ea9f3696348..f2a7c87504a 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -32,6 +32,29 @@ my $return = $MENU_INSTALL; require Tk; require Tk::Dialog; require Tk::PNG; +use utf8; +no utf8; + +if ($^O =~ /^MSWin(32|64)$/i) { + # trying to deduce automatically the country code + my $foo = TeXLive::TLWinGoo::reg_country(); + if ($foo) { + $::lang = $foo; + } else { + tllog($::LOG_DEBUG, "Didn't get any usuful code from reg_country: $foo...\n"); + } +} else { + # we load POSIX and locale stuff + require POSIX; + import POSIX qw/locale_h/; + # now we try to deduce $::lang + my $loc = setlocale(&POSIX::LC_CTYPE); + my ($lang,$area,$codeset); + if ($loc =~ m/^([^_.]*)(_([^.]*))?(\.([^@]*))?(@.*)?$/) { + $lang = defined($1)?$1:""; + } + $::lang = $lang if ($lang); +} my $mw; -- cgit v1.2.3