summaryrefslogtreecommitdiff
path: root/Master/install-tl
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2010-07-08 22:55:58 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2010-07-08 22:55:58 +0000
commit7cfe9e20cd7d24506adc62a38a078a714b19509f (patch)
tree5889cd0203120b4d3955aa7add2193977365625a /Master/install-tl
parente0ea7b22699470cd72a9f7d27a0eaf6a5354f752 (diff)
portable and from_dvd installations
git-svn-id: svn://tug.org/texlive/trunk@19292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-xMaster/install-tl78
1 files changed, 48 insertions, 30 deletions
diff --git a/Master/install-tl b/Master/install-tl
index e6f2cb3a50a..f8acda0b911 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -456,6 +456,11 @@ if (($media eq "NET") || ($media eq "CD")) {
$vars{'doc_splitting_supported'} = $tlpdb->config_doc_container;
}
$texlive_release = $tlpdb->config_release;
+if ($media eq "DVD") {
+ # existing installation will not have 00texlive.config metapackage
+ # so use TLConfig to establish what release we have
+ $texlive_release ||= $TeXLive::TLConfig::ReleaseYear;
+}
# if the release from the remote TLPDB does not agree with the
# TLConfig::ReleaseYear in the first 4 places break out here.
# Why only the first four places: some optional network distributions
@@ -628,7 +633,7 @@ sub do_installation {
}
$localtlpdb->save unless $vars{'from_dvd'};
do_postinst_stuff();
- if (win32()) {
+ if (win32() || $vars{'portable'}) {
print welcome();
} else {
print welcome_paths();
@@ -659,7 +664,9 @@ sub do_postinst_stuff {
#
# create package backup directory for tlmgr autobackup to work
- mkdirhier("$TEXDIR/$TeXLive::TLConfig::PackageBackupDir");
+ # unless installation is on non-writable media (from_dvd or live)
+ mkdirhier("$TEXDIR/$TeXLive::TLConfig::PackageBackupDir")
+ if ($vars{'TEXDIR'} eq $vars{'TEXDIRW'});
# final program execution
# we have to do several things:
@@ -669,16 +676,15 @@ sub do_postinst_stuff {
# - run the programs
# Step 1: Clean the environment.
- # VARS0 are always deleted, VARS1 deleted unless portable.
%origenv = %ENV;
my @TMFVARS0=qw(VARTEXFONTS
TEXMF SYSTEXMF VARTEXFONTS
TEXMFDBS WEB2C TEXINPUTS TEXFORMATS MFBASES MPMEMS TEXPOOL MFPOOL MPPOOL
- PSHEADERS TEXFONTMAPS TEXPSHEADERS TEXCONFIG TEXMFCNF);
- my @TMFVARS1=qw(TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG
+ PSHEADERS TEXFONTMAPS TEXPSHEADERS TEXCONFIG TEXMFCNF
+ TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG
TEXMFVAR TEXMFCONFIG TEXMFHOME TEXMFCACHE);
- if (defined($ENV{'TEXMFCNF'}) and !$vars{'from_dvd'} and !$vars{'portable'}) {
+ if (defined($ENV{'TEXMFCNF'}) and !$vars{'from_dvd'}) {
print "WARNING: environment variable TEXMFCNF is set.
You should know what you are doing.
We will remove that for the post install actions, but all further
@@ -687,11 +693,6 @@ operations might be disturbed.\n\n";
foreach $tmv (@TMFVARS0) {
delete $ENV{$tmv} if (defined($ENV{$tmv}));
}
- if (!$opt_portable) {
- foreach $tmv (@TMFVARS1) {
- delete $ENV{$tmv} if (defined($ENV{$tmv}));
- }
- }
if ($vars{'from_dvd'}) {
$ENV{'TEXMFSYSVAR'} = $vars{'TEXMFSYSVAR'};
$ENV{'TEXMFCNF'} = $vars{'TEXMFSYSVAR'}."/web2c";
@@ -929,19 +930,25 @@ sub do_texmf_cnf {
push @changedtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n";
}
} elsif ($line =~ m/^TEXMFVAR/) {
- push @newtmf, $line;
- if ($vars{"TEXMFVAR"} ne "~/.texlive$yyyy/texmf-var") {
+ if ($vars{"TEXMFVAR"} eq "~/.texlive$yyyy/texmf-var") {
+ push @newtmf, $line;
+ } else {
+ push @newtmf, "TEXMFVAR = $vars{'TEXMFVAR'}\n";
push @changedtmf, "TEXMFVAR = $vars{'TEXMFVAR'}\n";
$rewritetmflua = 1; # TEXMFVAR change -> new texmfcnf.lua
}
} elsif ($line =~ m/^TEXMFCONFIG/) {
- push @newtmf, $line;
- if ("$vars{'TEXMFCONFIG'}" ne "~/.texlive$yyyy/texmf-config") {
+ if ("$vars{'TEXMFCONFIG'}" eq "~/.texlive$yyyy/texmf-config") {
+ push @newtmf, $line;
+ } else {
+ push @newtmf, "TEXMFCONFIG = $vars{'TEXMFCONFIG'}\n";
push @changedtmf, "TEXMFCONFIG = $vars{'TEXMFCONFIG'}\n";
}
} elsif ($line =~ m/^TEXMFHOME/) {
- push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n";
- if ("$vars{'TEXMFHOME'}" ne "~/texmf") {
+ if ("$vars{'TEXMFHOME'}" eq "~/texmf") {
+ push @newtmf, $line;
+ } else {
+ push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n";
push @changedtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n";
}
} elsif ($line =~ m/^OSFONTDIR/) {
@@ -957,11 +964,15 @@ sub do_texmf_cnf {
}
if ($vars{'portable'}) {
+ push @newtmf, "ASYMPTOTE_HOME = \$TEXMFCONFIG/asymptote\n";
push @changedtmf, "ASYMPTOTE_HOME = \$TEXMFCONFIG/asymptote\n";
}
my ($TMF, $TMFLUA);
- if (!$vars{'from_dvd'}) {
+ if ($vars{'TEXDIR'} eq $vars{'TEXDIRW'}) {
+ # if TEXDIR == TEXDIRW we want to write only changes to texmf.cnf
+ # even for from_dvd installation (needed by tl-portable script to
+ # initialize an existing, writable installation for portable use)
$TMF = ">$vars{'TEXDIR'}/texmf.cnf";
open(TMF, $TMF) || die "open($TMF) failed: $!";
print TMF <<EOF;
@@ -975,7 +986,11 @@ sub do_texmf_cnf {
% And include *only* your changed values, not a copy of the whole thing!
%
EOF
- foreach (@changedtmf) { print TMF; }
+ foreach (@changedtmf) {
+ # avoid absolute paths for TEXDIR, use $SELFAUTOPARENT instead
+ s/^(TEXMF\w+\s*=\s*)\Q$vars{'TEXDIR'}\E/$1\$SELFAUTOPARENT/;
+ print TMF;
+ }
#
# save the setting of shell_escape to the generated system texmf.cnf
# default in texmf/web2c/texmf.cnf is
@@ -1072,7 +1087,9 @@ sub set_texlive_default_dirs {
} else {
$tex_prefix ||= '/usr/local/texlive';
}
- $vars{'TEXDIRW'} = "$tex_prefix/$texlive_release";
+ # for portable installation we want everything in one directory
+ $vars{'TEXDIRW'} = $vars{'portable'}
+ ? $tex_prefix : "$tex_prefix/$texlive_release";
my $texmfsysvar = getenv('TEXLIVE_INSTALL_TEXMFSYSVAR');
$texmfsysvar ||= $vars{'TEXDIRW'} . '/texmf-var';
@@ -1104,7 +1121,7 @@ sub set_texlive_default_dirs {
$vars{'TEXMFCONFIG'} = $texmfconfig;
# for portable installation we want everything in one directory
- if ($vars{'portable'} && !$vars{'from_dvd'}) {
+ if ($vars{'portable'}) {
$vars{'TEXMFHOME'} = "\$TEXMFLOCAL";
$vars{'TEXMFVAR'} = "\$TEXMFSYSVAR";
$vars{'TEXMFCONFIG'} = "\$TEXMFSYSCONFIG";
@@ -1304,6 +1321,8 @@ END_EXPLICIT_MIRROR
$vars{'option_sys_man'} = $tlpdb->option("sys_man");
$vars{'option_sys_info'} = $tlpdb->option("sys_info");
$vars{'option_write18_restricted'} = $tlpdb->option("write18_restricted");
+ # this option is not stored in tlpdb if an existing installation is used
+ $vars{'option_write18_restricted'} ||= 1;
# check that the default scheme is actually present, otherwise switch to
# scheme-minimal
@@ -1419,6 +1438,7 @@ sub create_profile {
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 =~ /^from_dvd/;
+ print $fh "$key $vars{$key}\n" if $key =~ /^portable/;
}
if (!ref($profilepath)) {
close PROFILE;
@@ -1467,8 +1487,6 @@ sub read_profile {
# helper subroutine to do sanity check of options before installation
sub sanitise_options {
- # from_dvd option overrides portable option
- $vars{'portable'} &&= !$vars{'from_dvd'};
# portable option overrides any system integration options
$vars{'option_path'} &&= !$vars{'portable'};
$vars{'option_file_assocs'} &&= !$vars{'portable'};
@@ -2069,8 +2087,9 @@ B<--no-persistent-downloads>.
=item B<-portable>
-Start the installer for portable use---but use the C<tl-portable>
-scripts instead of this option. See below for details.
+Install for portable use. This option minimazes the impact on the host
+system making TeX Live self-contained in a single directory and
+usable from portable drives. See also section B<PORTABLE USE> below.
=item B<-print-platform>
@@ -2131,12 +2150,11 @@ arguments can be separated from their options by either a space or C<=>.
=head1 PORTABLE USE
-The TeX Live root directory contains a shell script C<tl-portable.sh>
+The TeX Live root directory contains a shell script C<tl-portable>
and a DOS batch file C<tl-portable.bat> which start up a new shell and
-command prompt in which TeX Live can be run with minimal impact on the
-host system. These files start up C<install-tl> with the
-C<-portable> option for some minimal preparation. Don't use this option
-directly; it makes very specific assumptions about its environment.
+command prompt, respectively, in which TeX Live can be run with minimal
+impact on the host system. When running from non-writable medium some
+minimal preparation of the host system is done on the first run.
=head1 AUTHORS AND COPYRIGHT