summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-06-06 08:22:19 +0900
committerNorbert Preining <norbert@preining.info>2022-06-06 08:22:19 +0900
commitd0e719d80c0cd44d6c8ef16d79170c9a45f4094e (patch)
tree14a61ea2bfab147741059d0fac51cf26932920d2
parent4f2710ca193f06720b768ea2e46b5f1611c39cfb (diff)
Updates from Karl
-rwxr-xr-xMaster/install-tl51
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm19
-rw-r--r--Master/tlpkg/installer/install-menu-text.pl4
3 files changed, 39 insertions, 35 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 44748078016..3c55fa9949d 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -296,7 +296,7 @@ my $opt_version = 0;
my $opt_warn_checksums = 1;
my $opt_font;
my $opt_continue = 1;
-# no-interactive installation
+my $opt_installation = 1;
my $opt_interactive = 1;
my $opt_paper = "";
my $opt_texdir = "";
@@ -391,6 +391,7 @@ GetOptions(
"location|url|repository|repos|repo=s" => \$opt_location,
"no-cls", # $::opt_no_cls in install-menu-text-pl
"no-gui" => \$opt_no_gui,
+ "installation!", => \$opt_installation,
"interactive!", => \$opt_interactive,
"non-admin" => \$opt_nonadmin,
"paper=s" => \$opt_paper,
@@ -401,12 +402,12 @@ GetOptions(
"scheme=s" => \$opt_scheme,
"select-repository" => \$::opt_select_repository,
"texdir=s" => \$opt_texdir,
- "texmflocal=s" => \$pathopts{'texmflocal'},
- "texmfhome=s" => \$pathopts{'texmfhome'},
- "texmfvar=s" => \$pathopts{'texmfvar'},
"texmfconfig=s" => \$pathopts{'texmfconfig'},
- "texmfsysvar=s" => \$pathopts{'texmfsysvar'},
+ "texmfhome=s" => \$pathopts{'texmfhome'},
+ "texmflocal=s" => \$pathopts{'texmflocal'},
"texmfsysconfig=s" => \$pathopts{'texmfsysconfig'},
+ "texmfsysvar=s" => \$pathopts{'texmfsysvar'},
+ "texmfvar=s" => \$pathopts{'texmfvar'},
"texuserdir=s" => \$opt_texuserdir,
"font=s" => \$opt_font,
"tcl", # handled by wrapper
@@ -484,18 +485,22 @@ load_translations();
# some option checks
-die "$0: Options custom-bin and in-place are incompatible.\n"
+die "$0: Incompatible options: custom-bin and in-place.\n"
if ($opt_in_place && $opt_custom_bin);
-die "$0: Options profile and in-place are incompatible.\n"
+die "$0: Incompatible options: in-place and profile ($opt_profile).\n"
if ($opt_in_place && $opt_profile);
-die "$0: Options init-from-profile and in-place are incompatible.\n"
+die "$0: Incompatible options init-from-profile and in-place.\n"
if ($opt_in_place && $opt_init_from_profile);
-die "$0: Options texuserdir and any of texmfhome, texmfconfig, texmfvar are incompatible.\n"
+die "$0: Incompatible options: texuserdir ($opt_texuserdir) and "
+ . "any of texmfhome, texmfconfig, texmfvar ("
+ . "$pathopts{'texmfhome'}, $pathopts{'texmfvar'}, $pathopts{'texmfconfig'}"
+ . ").\n"
if ($opt_texuserdir &&
- ($pathopts{'texmfhome'} || $pathopts{'texmfvar'} || $pathopts{'texmfconfig'}));
+ ($pathopts{'texmfhome'} || $pathopts{'texmfvar'}
+ || $pathopts{'texmfconfig'}));
if ($#ARGV >= 0) {
die "$0: Extra arguments `@ARGV'; try --help if you need it.\n";
@@ -730,7 +735,7 @@ $::env_warns = "";
create_welcome();
my $status = 1;
if ($opt_gui eq 'text' or $opt_gui eq 'extl' or $opt_profile ne "") {
- $status = do_installation();
+ $status = $opt_installation && do_installation();
if (@::WARNLINES) {
foreach my $t (@::WARNLINES) { print STDERR $t; }
}
@@ -957,7 +962,8 @@ sub do_installation {
tldie("$0: Nothing selected, nothing to install, exiting!\n");
}
# expand ~ in various variables just to be sure
- for my $v (qw/TEXDIR TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFHOME TEXMFVAR TEXMFCONFIG/) {
+ for my $v (qw/TEXDIR TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFHOME
+ TEXMFVAR TEXMFCONFIG/) {
$vars{$v} = TeXLive::TLUtils::expand_tilde($vars{$v}) if ($vars{$v});
}
# maybe_make_ro tests for admin, local drive and NTFS before proceeding.
@@ -1212,7 +1218,6 @@ operations might be disturbed.\n\n";
tlwarn("Old configuration file $TEXMFLOCAL/web2c/fmtutil-local.cnf found.\n");
tlwarn("fmtutil now reads *all* fmtutil.cnf files, so probably the easiest way\nis to rename the above file to $TEXMFLOCAL/web2c/fmtutil.cnf\n");
}
-
info("writing updmap.cfg to $TEXDIR/texmf-dist/web2c/updmap.cfg\n");
TeXLive::TLUtils::create_updmap ($usedtlpdb,
@@ -1665,10 +1670,11 @@ sub set_standard_var {
tlwarn(" Preferring the last value from above!\n");
# actual preference order is given via the below call
}
- # default for most variables is in increasing priority
+ # default for most variables, in increasing priority
# - some default
- # - setting from profile saved already in $vars{$what}
# - environment variable
+ # - setting from profile saved already in $vars{$what}
+ # - command line
set_var_from_alternatives( $what, \$vars{$what},
$cmdlinevar,
$vars{$what},
@@ -1681,15 +1687,15 @@ sub set_texlive_default_dirs {
my $yyyy = $TeXLive::TLConfig::ReleaseYear;
#
# We already checked that either $opt_texuserdir xor at least one of the
- # direct (texmfhome, texmfvar, texmfconfig) is set. In case that
- # $opt_texuserdir is set, assign the respective values to texmfhome etc
+ # directory options (texmfhome, texmfvar, texmfconfig) is set. In case
+ # $opt_texuserdir is set, assign the respective values to texmfhome etc.
if ($opt_texuserdir) {
$pathopts{'texmfhome'} = "$opt_texuserdir/texmf";
$pathopts{'texmfvar'} = "$opt_texuserdir/texmf-var";
$pathopts{'texmfconfig'} = "$opt_texuserdir/texmf-config";
}
#
- # Sources of target directory settings
+ # Sources of target directory settings in priority order:
# - env variable TEXLIVE_INSTALL_PREFIX
# will be used with YYYY (in portable case without)
# - --texdir cmd line option
@@ -1740,12 +1746,10 @@ sub set_texlive_default_dirs {
set_standard_var('TEXMFHOME', 'TEXLIVE_INSTALL_TEXMFHOME', 'texmfhome',
"$homedir/texmf");
set_standard_var('TEXMFVAR', 'TEXLIVE_INSTALL_TEXMFVAR', 'texmfvar',
- (platform() =~ m/darwin/)
- ? "$homedir/texlive/$yyyy/texmf-var"
+ (platform() =~ m/darwin/) ? "$homedir/texlive/$yyyy/texmf-var"
: "$homedir/.texlive$yyyy/texmf-var");
set_standard_var('TEXMFCONFIG', 'TEXLIVE_INSTALL_TEXMFCONFIG', 'texmfconfig',
- (platform() =~ m/darwin/)
- ? "$homedir/texlive/$yyyy/texmf-config"
+ (platform() =~ m/darwin/) ? "$homedir/texlive/$yyyy/texmf-config"
: "$homedir/.texlive$yyyy/texmf-config");
# for portable installation we want everything in one directory
@@ -1758,7 +1762,8 @@ sub set_texlive_default_dirs {
# terminate here if we debug only setting variables
if ($opt_debug_setup_vars) {
print "Final values from setup of paths:\n";
- for my $i (qw/TEXDIR TEXMFSYSVAR TEXMFSYSCONFIG TEXMFHOME TEXMFVAR TEXMFCONFIG TEXMFLOCAL/) {
+ for my $i (qw/TEXDIR TEXMFSYSVAR TEXMFSYSCONFIG TEXMFHOME TEXMFVAR
+ TEXMFCONFIG TEXMFLOCAL/) {
print "$i = $vars{$i}\n";
}
exit(1);
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index da229c052a0..7a6936645db 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -277,9 +277,6 @@ $::opt_verbosity = 0; # see process_logging_options
our $SshURIRegex = '^((ssh|scp)://([^@]*)@([^/]*)/|([^@]*)@([^:]*):).*$';
-# only search for home directory once, and save expansion here
-my $user_home_dir;
-
=head2 Platform detection
=over 4
@@ -897,21 +894,23 @@ sub diskfree {
Returns the current user's home directory (C<$HOME> on Unix,
C<$USERPROFILE> on Windows, and C<~> if none of the two are
-set.
+set. Save in package variable C<$user_home_dir> after computing.
=cut
+# only search for home directory once, and save expansion here
+my $user_home_dir;
+
sub get_user_home {
return $user_home_dir if ($user_home_dir);
- $user_home_dir = getenv('HOME');
- $user_home_dir = getenv('USERPROFILE') if win32();
- $user_home_dir ||= '~';
- return($user_home_dir);
+ $user_home_dir = getenv (win32() ? 'USERPROFILE' : 'HOME') || '~';
+ return $user_home_dir;
}
=item C<expand_tilde($str)>
-Expands initial C<~> with the user's home directory in C<$str>.
+Expands initial C<~> with the user's home directory in C<$str> if
+available, else leave C<~> in place.
=cut
@@ -919,7 +918,7 @@ sub expand_tilde {
my $str = shift;
my $h = get_user_home();
$str =~ s/^~/$h/;
- return($str);
+ return $str;
}
=back
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index f91cfd6f4cd..9f7060d3d28 100644
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -623,7 +623,7 @@ sub input_dirname
$answer =~ s!\\!/!g if win32(); # switch to forward slashes
if (!$noexpansion) {
- $answer = $TeXLive::TLUtils::expand_tilde($answer);
+ $answer = TeXLive::TLUtils::expand_tilde($answer);
}
if ($answer !~ m/^~/) {
@@ -720,7 +720,7 @@ sub help_menu {
clear_screen;
- my @text=html2text "$installer_help";
+ my @text=html2text ($installer_help);
my $lines=(@text);
my $overlap=3;
my $lps=32; # lines per screen - overlap