From 3f173002d4a4a84e7d1fa5a74755fdd00d08a9c2 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 2 Apr 2021 03:20:54 +0000 Subject: CTAN sync 202104020320 --- systems/texlive/tlnet/install-tl | 131 +++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 75 deletions(-) (limited to 'systems/texlive/tlnet/install-tl') diff --git a/systems/texlive/tlnet/install-tl b/systems/texlive/tlnet/install-tl index ec655867ee..470abdafda 100755 --- a/systems/texlive/tlnet/install-tl +++ b/systems/texlive/tlnet/install-tl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: install-tl 57772 2021-02-17 19:01:36Z karl $ +# $Id: install-tl 58690 2021-03-24 22:12:09Z preining $ # Copyright 2007-2021 # Reinhard Kotucha, Norbert Preining, Karl Berry, Siep Kroonenberg. # This file is licensed under the GNU General Public License version 2 @@ -8,7 +8,7 @@ # Be careful when changing wording: *every* normal informational message # output here must be recognized by the long grep in tl-update-tlnet. -my $svnrev = '$Revision: 57772 $'; +my $svnrev = '$Revision: 58690 $'; $svnrev =~ m/: ([0-9]+) /; $::installerrevision = ($1 ? $1 : 'unknown'); @@ -44,6 +44,11 @@ sub dblog { close $dbf; } +sub dblogsub { + my $s = shift; + my @stck = (caller(1)); + dblog "$stck[3] $s"; +} # On unix, this run of install-tl may do duty as a wrapper for # install-tl-gui.tcl, which in its turn will start an actual run of install-tl. @@ -152,6 +157,27 @@ use TeXLive::TLCrypto; use TeXLive::TLDownload; use TeXLive::TLPaper; +use Encode::Alias; +eval { + require Encode::Locale; + Encode::Locale->import (); + debug("Encode::Locale is loaded.\n"); +}; +if ($@) { + if (win32) { + die ("For Windows, Encode::Locale is required.\n"); + } + + debug("Encode::Locale is not found. Assuming all encodings are UTF-8.\n"); + Encode::Alias::define_alias('locale' => 'UTF-8'); + Encode::Alias::define_alias('locale_fs' => 'UTF-8'); + Encode::Alias::define_alias('console_in' => 'UTF-8'); + Encode::Alias::define_alias('console_out' => 'UTF-8'); +} +binmode (STDIN, ':encoding(console_in)'); +binmode (STDOUT, ':encoding(console_out)'); +binmode (STDERR, ':encoding(console_out)'); + if (win32) { require TeXLive::TLWinGoo; TeXLive::TLWinGoo->import( qw( @@ -288,16 +314,11 @@ $::lang = "en"; # use the fancy directory selector for TEXDIR # no longer used, although we still accept the parameter -$::alternative_selector = 0; +#$::alternative_selector = 0; # do not debug translations by default $::debug_translation = 0; -# some strings to describe the different meanings of tlpdbopt_file_assoc -$::fileassocdesc[0] = "None"; -$::fileassocdesc[1] = "Only new"; -$::fileassocdesc[2] = "All"; - # before we try to interact with the user, we need to know whether or not # install-tl was called from an external gui. This gui will start install-tl # with "-from_ext_gui" as its first command-line option. @@ -315,8 +336,6 @@ if ((defined $ARGV[0]) && $ARGV[0] eq "-from_ext_gui") { # windows: suppress console windows when invoking other programs Win32::SetChildShowWindow(0) if win32(); - # ___, defined in this file, replaces the GUI translating function - *__ = \&::___; } # if we find a file installation.profile we ask the user whether we should @@ -346,13 +365,12 @@ GetOptions( "all-options" => \$::opt_all_options, "custom-bin=s" => \$opt_custom_bin, "debug-translation" => \$::debug_translation, - "fancyselector" => \$::alternative_selector, + "fancyselector", "force-platform|force-arch=s" => \$opt_force_arch, "gui:s" => \$opt_gui, "in-place" => \$opt_in_place, "init-from-profile=s" => \$opt_init_from_profile, - "lang=s" => \$::opt_lang, - "gui-lang=s" => \$::opt_lang, + "lang|gui-lang=s" => \$::opt_lang, "location|url|repository|repos|repo=s" => \$opt_location, "no-cls", # $::opt_no_cls in install-menu-text-pl "no-gui" => \$opt_no_gui, @@ -373,6 +391,8 @@ if ($from_ext_gui) { $opt_gui = "extl"; } +# informational invocations: help, version, platform + if ($opt_help) { # theoretically we could make a subroutine with all the same # painful checks as we do in tlmgr, but let's not bother until people ask. @@ -423,6 +443,20 @@ if ($opt_version) { exit 0; } +if ($opt_print_arch) { + print platform()."\n"; + exit 0; +} + +# now load translations, if applicable +if (defined($::opt_lang)) { + $::lang = $::opt_lang; +} +require("TeXLive/trans.pl"); +load_translations(); + +# some option checks + die "$0: Options custom-bin and in-place are incompatible.\n" if ($opt_in_place && $opt_custom_bin); @@ -437,10 +471,6 @@ if ($#ARGV >= 0) { } -if (defined($::opt_lang)) { - $::lang = $::opt_lang; -} - if ($opt_profile) { # not allowed if in_place if (-r $opt_profile && -f $opt_profile) { info("Automated TeX Live installation using profile: $opt_profile\n"); @@ -455,6 +485,8 @@ if ($opt_nonadmin and win32()) { non_admin(); } +# done with options + # the TLPDB instances we will use. $tlpdb is for the one from the installation # media, while $localtlpdb is for the new installation @@ -470,12 +502,6 @@ our @media_available; TeXLive::TLUtils::initialize_global_tmpdir(); -# special uses of install-tl: -if ($opt_print_arch) { - print platform()."\n"; - exit 0; -} - if (TeXLive::TLCrypto::setup_checksum_method()) { # try to setup gpg: # either explicitly requested or nothing requested @@ -649,7 +675,6 @@ if ($opt_profile eq "") { exit(3); } } else { # no interactive setting of options - *__ = \&::___; if (!do_remote_init()) { die ("Exiting installation.\n"); } @@ -673,14 +698,13 @@ info("Installing to: $vars{TEXDIR}\n"); $::env_warns = ""; create_welcome(); my $status = 1; -if ($opt_gui eq 'text' or $opt_gui eq 'extl' or $opt_profile ne "" or - !(-r "$::installerdir/tlpkg/installer/tracked-install.pl")) { +if ($opt_gui eq 'text' or $opt_gui eq 'extl' or $opt_profile ne "") { $status = do_installation(); if (@::WARNLINES) { foreach my $t (@::WARNLINES) { print STDERR $t; } } if ($::env_warns) { tlwarn($::env_warns); } - unless ($ENV{"TEXLIVE_INSTALL_NO_WELCOME"} or $opt_gui eq 'extl') { + unless ($ENV{"TEXLIVE_INSTALL_NO_WELCOME"}) { info(join("\n", @::welcome_arr)); } do_cleanup(); # sets $::LOGFILENAME if not already defined @@ -694,9 +718,6 @@ if ($opt_gui eq 'text' or $opt_gui eq 'extl' or $opt_profile ne "" or } printf STDOUT "Installed on platform %s at %s\n", $vars{'this_platform'}, $vars{'TEXDIR'} if ($opt_gui eq 'extl'); -} else { - require("installer/tracked-install.pl"); - $status = installer_tracker(); } exit $status; @@ -1652,7 +1673,8 @@ sub calc_depends { if (grep(/^win32$/,@archs)) { $install{"tlperl.win32"} = 1; $install{"tlgs.win32"} = 1; - $install{"tlpsv.win32"} = 1; + # tlpsv is gone + # $install{"tlpsv.win32"} = 1; } # loop over all the packages until it is getting stable @@ -2489,7 +2511,7 @@ sub do_cleanup { if (!defined($::LOGFILE)) { # no -logfile option; nothing written yet $::LOGFILENAME = "$vars{'TEXDIR'}/install-tl.log"; - if (open(LOGF,">$::LOGFILENAME")) { + if (open(LOGF,">:utf8", $::LOGFILENAME)) { $::LOGFILE = \*LOGF; foreach my $line(@::LOGLINES) { print $::LOGFILE "$line"; @@ -2522,6 +2544,7 @@ sub check_env { |PATH |PERL5LIB |SHELLOPTS + |WISH )$/x; # don't worry about these if ("$evar $origenv{$evar}" =~ /tex/i) { # check both key and value $::env_warns .= " $evar=$origenv{$evar}\n"; @@ -2602,48 +2625,6 @@ sub deselect_collections { } } -# assign \&___ to *__ if __ is not otherwise defined -sub ___ { - my $s = shift; - return wrapped (sprintf($s, @_)); -} - -sub wrapped { - my $t = shift; - my $toolong = '.{79}'; - if ($t !~ $toolong) { - return $t; - } else { - my @lines = split /\n/, $t; - foreach my $l (@lines) { - if ($l !~ $toolong) { - next; # leave $l alone - } - my @words = split /\s+/, $l; - if (! @words) { - $l = ""; - next; - } else { - my $indent = $l; - $indent =~ s/^(\s*).*$/$1/; # extract leading spaces - my @broken = (); - my $inx = 0; - while (@words) { - if (not ((defined $broken[$inx]) && ($broken[$inx] =~ /\S/))) { - $broken[$inx] = $indent . (shift @words); - } elsif (($broken[$inx] . " " . $words[0]) =~ $toolong) { - $inx++; # NO word consumed, still words remaining - } else { - $broken[$inx] = $broken[$inx] . " " . (shift @words); - } # $l =~ $toolong - } # while @words - $l = join "\n", @broken; - } # @words - } # foreach my $l - return join "\n", @lines; - } # $t =~ $toolong -} # wrapped - __END__ @@ -3137,7 +3118,7 @@ This script and its documentation were written for the TeX Live distribution (L) and both are licensed under the GNU General Public License Version 2 or later. -$Id: install-tl 57772 2021-02-17 19:01:36Z karl $ +$Id: install-tl 58690 2021-03-24 22:12:09Z preining $ =cut # to remake HTML version: pod2html --cachedir=/tmp install-tl >/tmp/itl.html -- cgit v1.2.3