summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-04-16 02:13:09 +0000
committerNorbert Preining <preining@logic.at>2017-04-16 02:13:09 +0000
commit219afd32966778a9ba24a031a7a820c3288b4eba (patch)
tree538a600ca2e8befab68a3d32bca693452d47820b
parente5850974f8685e99c3164638a17bea64b18deade (diff)
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
-rwxr-xr-xMaster/install-tl31
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl13
-rw-r--r--Master/tlpkg/installer/install-menu-text.pl21
3 files changed, 32 insertions, 33 deletions
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 {
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index 14606b03bf0..fd3cf112309 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -34,6 +34,7 @@ use utf8;
no utf8;
our %vars;
+our $opt_in_place;
our $tlpdb;
our @collections_std;
our $texlive_release;
@@ -306,7 +307,7 @@ Please select a different mirror.',
}
})->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
}
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
$row++;
$fr->Label(-text => "------- " . __("Basic Information") . " -------")
@@ -376,7 +377,7 @@ Please select a different mirror.',
->grid(-row => $row, -column => 1, -sticky => 'w');
$texdirtext = $fr->Label(-anchor => 'w')
->grid(-row => $row, -column => 2, -padx => "2m");
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
if ($::alternative_selector) {
$texdir_toggle_button = $fr->Button(
-text => __("Change"), -command => sub { menu_edit_texdir("TEXDIR"); })
@@ -493,7 +494,7 @@ Please select a different mirror.',
toggle_and_set_opt_variable(\$vars{'option_fmt'}, \$fmtyesno); })
->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
- if ($vars{'doc_splitting_supported'} and !$vars{'in_place'}) {
+ if ($vars{'doc_splitting_supported'} and !$opt_in_place) {
$row++;
$fr->Label(-text => __('Install font/macro doc tree'), -anchor => 'w')
->grid(-row => $row, -column => 1, -sticky => 'w');
@@ -506,7 +507,7 @@ Please select a different mirror.',
->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
}
- if ($vars{'src_splitting_supported'} and !$vars{'in_place'}) {
+ if ($vars{'src_splitting_supported'} and !$opt_in_place) {
$row++;
$fr->Label(-text => __('Install font/macro source tree'), -anchor => 'w')
->grid(-row => $row, -column => 1, -sticky => 'w');
@@ -583,7 +584,7 @@ Please select a different mirror.',
->grid(-row => $row, -column => 1, -sticky => 'w');
$fr->Label(-anchor => 'w', -textvariable => \$editoryesno)
->grid(-row => $row, -column => 2, -padx => "2m");
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
$texworks_toggle_button = $fr->Button(
-text => __("Toggle"),
-command => sub {
@@ -705,7 +706,7 @@ sub pre_warn {
return $ans eq $b_quit;
}
-# this sub will not be called if $vars{'in_place'}
+# this sub will not be called if $opt_in_place
sub menu_edit_texdir {
my $key = shift;
our $addyear = 1;
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index edb68277872..521fa0af8cc 100644
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -12,6 +12,7 @@
use vars qw(@::end_install_hook $::opt_no_cls);
our %vars;
+our $opt_in_place;
our $tlpdb;
our @media_available;
our $media;
@@ -508,7 +509,7 @@ sub directories_menu
}
my $texmfdir = $vars{'TEXDIR'} .
($vars{'TEXDIR'} =~ /\/$/ ? 'texmf-dist' : '/texmf-dist');
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
print <<"EOF";
<1> TEXDIR: $vars{'TEXDIR'}
support tree: $texmfdir
@@ -542,7 +543,7 @@ EOF
other_options qw(R Q);
my $answer = prompt 'Enter command';
- if ("\u$answer" eq '1' and !$vars{'in_place'}) {
+ if ("\u$answer" eq '1' and !$opt_in_place) {
print "New value for TEXDIR [$vars{'TEXDIR'}]: ";
$answer = &input_dirname ();
$vars{'TEXDIR'} = $answer if $answer ne "";
@@ -792,10 +793,10 @@ sub options_menu {
<F> create format files: $b_fmt
EOF
;
- if ($vars{'doc_splitting_supported'} and !$vars{'in_place'}) {
+ if ($vars{'doc_splitting_supported'} and !$opt_in_place) {
print " <D> install font/macro doc tree: $b_doc\n";
}
- if ($vars{'src_splitting_supported'} and !$vars{'in_place'}) {
+ if ($vars{'src_splitting_supported'} and !$opt_in_place) {
print " <S> install font/macro source tree: $b_src\n";
}
if (!$vars{'portable'}) {
@@ -922,11 +923,11 @@ EOF
toggle 'option_write18_restricted';
return $command{'self'};
- } elsif ("\u$answer" eq 'S' and !$vars{'in_place'}) {
+ } elsif ("\u$answer" eq 'S' and !$opt_in_place) {
toggle 'option_src';
return $command{'self'};
- } elsif ("\u$answer" eq 'D' and !$vars{'in_place'}) {
+ } elsif ("\u$answer" eq 'D' and !$opt_in_place) {
toggle 'option_doc';
return $command{'self'};
@@ -934,7 +935,7 @@ EOF
return $command{"\u$answer"};
} elsif (("\u$answer" eq 'W') && ($::opt_all_options || win32()) &&
- !$vars{'in_place'} ) {
+ !$opt_in_place ) {
toggle 'collection-texworks';
return $command{'self'};
@@ -1026,7 +1027,7 @@ sub main_menu {
'V' => \&toggle_portable,
'P' => \&callback_save_profile,
);
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
$command{'B'} = \&binary_menu if unix();
$command{'C'} = \&collection_menu;
$command{'S'} = \&scheme_menu;
@@ -1043,7 +1044,7 @@ sub main_menu {
$warn_nobin
EOF
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
print <<"EOF";
<B> set binary platforms: $vars{'n_systems_selected'} out of $vars{'n_systems_available'}
@@ -1093,7 +1094,7 @@ print <<"EOF";
$b_fmt create all format files
EOF
- if (!$vars{'in_place'}) {
+ if (!$opt_in_place) {
if ($vars{'doc_splitting_supported'}) {
print " $b_doc install macro/font doc tree\n";
}