summaryrefslogtreecommitdiff
path: root/Master/install-tl.pl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-01-19 17:53:56 +0000
committerNorbert Preining <preining@logic.at>2008-01-19 17:53:56 +0000
commit485c4b69dfd36ce1c6b800935f7ce4a7aa1c95a9 (patch)
tree025edf409841a20a7763b22932edb35707ec4714 /Master/install-tl.pl
parentaa49d07709a24a7de56034b3002f20b0eac9b38d (diff)
for unix: automatic language selection ... try
LC_CTYPE=de_AT.latin1 perl install-tl.pl -gui or LC_CTYPE=it_IT.utf8 perl install-tl.pl -gui git-svn-id: svn://tug.org/texlive/trunk@6321 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl.pl')
-rwxr-xr-xMaster/install-tl.pl21
1 files changed, 20 insertions, 1 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index 50295da8b52..5100203d9d2 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -49,6 +49,25 @@ use TeXLive::TLConfig qw($DefaultContainerExtension $InfraLocation);
use TeXLive::TLWinGoo;
use Getopt::Long;
+# default language
+$::lang = "en";
+$::charset = "latin1";
+if ($^O !~ /^MSWin(32|64)$/i) {
+ # we load POSIX and locale stuff
+ require POSIX;
+ import POSIX qw/locale_h/;
+ # now we try to deduce $::charset and $::lang
+ my $loc = setlocale(&POSIX::LC_CTYPE);
+ my ($lang,$area,$codeset);
+ if ($loc =~ m/^([^_.]*)(_([^.]*))?(\.([^@]*))?(@.*)?$/) {
+ $lang = defined($1)?$1:"";
+ $area = defined($3)?$3:"";
+ $codeset = defined($5)?$5:"";
+ }
+ $::lang = $lang if ($lang);
+ $::charset = $codeset if ($codeset);
+}
+
use strict;
# debugging/logging cmd lines options:
@@ -121,7 +140,6 @@ my $opt_quiet = 0;
my $opt_qquiet = 0;
$::netarchive = "archive";
$::diskarchive = "archive";
-$::lang = "en";
GetOptions("media=s" => \$opt_media,
"profile=s"=> \$opt_profile,
@@ -130,6 +148,7 @@ GetOptions("media=s" => \$opt_media,
"netarchive=s" => \$::netarchive,
"diskarchive=s" => \$::diskarchive,
"lang=s" => \$::lang,
+ "charset=s" => \$::charset,
"d" => \$opt_debug,
"dd" => \$opt_ddebug,
"ddd" => \$opt_dddebug,