From 219afd32966778a9ba24a031a7a820c3288b4eba Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 16 Apr 2017 02:13:09 +0000 Subject: treat $opt_in_place special and don't save it into %vars git-svn-id: svn://tug.org/texlive/trunk@43823 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'Master/install-tl') diff --git a/Master/install-tl b/Master/install-tl index 02fdb6fab59..4de67782fab 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -145,12 +145,11 @@ our %vars=( # 'n_' means 'number of'. 'src_splitting_supported' => 1, 'doc_splitting_supported' => 1, 'selected_scheme' => $default_scheme, - 'in_place' => 0, 'portable' => 0, ); # option handling -my $opt_in_place = 0; +our $opt_in_place = 0; my $opt_gui = (win32() ? "wizard" : "text"); my $opt_help = 0; my $opt_location = ""; @@ -730,7 +729,6 @@ sub final_remote_init { print "Installer dir not writable; 'in_place' option not applicable\n"; $opt_in_place = 0; } - $vars{'in_place'} = $opt_in_place; $opt_scheme = "" if $opt_in_place; $vars{'portable'} = $opt_portable; @@ -797,13 +795,13 @@ sub do_installation { TeXLive::TLWinGoo::maybe_make_ro ($vars{'TEXMFSYSCONFIG'}); } - if ($vars{'in_place'}) { + if ($opt_in_place) { $localtlpdb = $tlpdb; } else { $localtlpdb=new TeXLive::TLPDB; $localtlpdb->root("$vars{'TEXDIR'}"); } - if (!$vars{'in_place'}) { + if (!$opt_in_place) { # have to do top-level release-texlive.txt as a special file, so # tl-update-images can insert the final version number without # having to remake any packages. But if the source does not exist, @@ -858,7 +856,7 @@ sub do_installation { "release/" . $tlpdb->config_release); $localtlpdb->add_tlpobj($tlpobj); - $localtlpdb->save unless $vars{'in_place'}; + $localtlpdb->save unless $opt_in_place; my $errcount = do_postinst_stuff(); @@ -981,7 +979,7 @@ operations might be disturbed.\n\n"; # post install actions # - my $usedtlpdb = $vars{'in_place'} ? $tlpdb : $localtlpdb; + my $usedtlpdb = $opt_in_place ? $tlpdb : $localtlpdb; if (win32()) { debug("Actual environment:\n" . `set` ."\n\n"); @@ -991,7 +989,7 @@ operations might be disturbed.\n\n"; # Step 4: run the programs my $errcount = 0; - if (!$vars{'in_place'}) { + if (!$opt_in_place) { $errcount += wsystem("running", 'mktexlsr', "$TEXDIR/texmf-dist"); } @@ -1064,7 +1062,7 @@ operations might be disturbed.\n\n"; # now rerun mktexlsr for updmap-sys and tlmgr paper letter updates. $errcount += wsystem("re-running", "mktexlsr", $TEXMFSYSVAR,$TEXMFSYSCONFIG); - if (win32() and !$vars{'portable'} and !$vars{'in_place'}) { + if (win32() and !$vars{'portable'} and !$opt_in_place) { if ($vars{'option_desktop_integration'} != 2) { create_uninstaller($vars{'TEXDIR'}); } else { @@ -1118,7 +1116,7 @@ sub do_tlpdb_postactions { info ("running package-specific postactions\n"); # option settings already reflect portable- and in_place options. - my $usedtlpdb = $vars{'in_place'} ? $tlpdb : $localtlpdb; + my $usedtlpdb = $opt_in_place ? $tlpdb : $localtlpdb; my $ret = 0; # n. of errors foreach my $package ($usedtlpdb->list_packages) { @@ -1384,8 +1382,8 @@ sub set_platforms_supported { # TEXLIVE_INSTALL_TEXMFCONFIG ~/.texlive2010/texmf-config sub set_texlive_default_dirs { - my $tex_prefix = $vars{'in_place'} ? abs_path($::installerdir) - : getenv('TEXLIVE_INSTALL_PREFIX'); + my $tex_prefix = $opt_in_place ? abs_path($::installerdir) + : getenv('TEXLIVE_INSTALL_PREFIX'); if (win32) { $tex_prefix ||= getenv('SystemDrive') . '/texlive'; # we use SystemDrive because ProgramFiles requires admin rights @@ -1395,7 +1393,7 @@ sub set_texlive_default_dirs { $tex_prefix ||= '/usr/local/texlive'; } # for portable and in_place installation we want everything in one directory - $vars{'TEXDIR'} = ($vars{'portable'} || $vars{'in_place'}) + $vars{'TEXDIR'} = ($vars{'portable'} || $opt_in_place) ? $tex_prefix : "$tex_prefix/$texlive_release"; my $texmfsysvar = getenv('TEXLIVE_INSTALL_TEXMFSYSVAR'); @@ -1410,7 +1408,7 @@ sub set_texlive_default_dirs { $texmflocal ||= "$tex_prefix/texmf-local"; $vars{'TEXMFLOCAL'} = $texmflocal; - $vars{'TEXDIR'} = $vars{'in_place'} + $vars{'TEXDIR'} = $opt_in_place ? abs_path($::installerdir) : $vars{'TEXDIR'}; my $texmfhome = getenv('TEXLIVE_INSTALL_TEXMFHOME'); @@ -1766,7 +1764,6 @@ sub create_profile { print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFCONFIG/; print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFLOCAL/; print $fh "$key $vars{$key}\n" if $key =~ /^TEXMFHOME/; - print $fh "$key $vars{$key}\n" if $key =~ /^in_place/; print $fh "$key $vars{$key}\n" if $key =~ /^portable/; } if (!ref($profilepath)) { @@ -1901,7 +1898,7 @@ sub save_options_into_tlpdb { $localtlpdb->setting ("platform", $::_platform_); } $localtlpdb->setting("available_architectures", @archs); - $localtlpdb->save() unless $vars{'in_place'}; + $localtlpdb->save() unless $opt_in_place; } # save_options_into_tlpdb sub import_settings_from_old_tlpdb { @@ -2195,7 +2192,7 @@ sub do_cleanup { } # write the profile out - if ($vars{'in_place'}) { + if ($opt_in_place) { create_profile("$vars{'TEXDIR'}/texlive.profile"); debug("Profile written to $vars{'TEXDIR'}/texlive.profile\n"); } else { -- cgit v1.2.3