texlive[43823] Master: treat $opt_in_place special and don't save it
commits+preining at tug.org
commits+preining at tug.org
Sun Apr 16 04:13:09 CEST 2017
Revision: 43823
http://tug.org/svn/texlive?view=revision&revision=43823
Author: preining
Date: 2017-04-16 04:13:09 +0200 (Sun, 16 Apr 2017)
Log Message:
-----------
treat $opt_in_place special and don't save it into %vars
Modified Paths:
--------------
trunk/Master/install-tl
trunk/Master/tlpkg/installer/install-menu-perltk.pl
trunk/Master/tlpkg/installer/install-menu-text.pl
Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl 2017-04-16 02:13:01 UTC (rev 43822)
+++ trunk/Master/install-tl 2017-04-16 02:13:09 UTC (rev 43823)
@@ -145,12 +145,11 @@
'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 @@
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 @@
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 @@
"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 @@
# 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 @@
# 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 @@
# 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 @@
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 @@
# 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 @@
$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 @@
$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 @@
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 @@
$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 @@
}
# 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 {
Modified: trunk/Master/tlpkg/installer/install-menu-perltk.pl
===================================================================
--- trunk/Master/tlpkg/installer/install-menu-perltk.pl 2017-04-16 02:13:01 UTC (rev 43822)
+++ trunk/Master/tlpkg/installer/install-menu-perltk.pl 2017-04-16 02:13:09 UTC (rev 43823)
@@ -34,6 +34,7 @@
no utf8;
our %vars;
+our $opt_in_place;
our $tlpdb;
our @collections_std;
our $texlive_release;
@@ -306,7 +307,7 @@
}
})->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 @@
->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 @@
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 @@
->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 @@
->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 @@
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;
Modified: trunk/Master/tlpkg/installer/install-menu-text.pl
===================================================================
--- trunk/Master/tlpkg/installer/install-menu-text.pl 2017-04-16 02:13:01 UTC (rev 43822)
+++ trunk/Master/tlpkg/installer/install-menu-text.pl 2017-04-16 02:13:09 UTC (rev 43823)
@@ -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 @@
}
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 @@
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 @@
<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 @@
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 @@
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 @@
'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 @@
$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 @@
$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";
}
More information about the tex-live-commits
mailing list