diff options
author | Reinhard Kotucha <reinhard.kotucha@web.de> | 2008-01-26 15:11:39 +0000 |
---|---|---|
committer | Reinhard Kotucha <reinhard.kotucha@web.de> | 2008-01-26 15:11:39 +0000 |
commit | 6d432641de726748fb129b692fef24385bd90ca2 (patch) | |
tree | a6f26367deaa102247d2a949b46ade8ba65a9280 /Master | |
parent | 33190ad083f274e1c115f9accea810903efed71a (diff) |
install-tl.pl: clean up post-install stuff.
git-svn-id: svn://tug.org/texlive/trunk@6422 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl.pl | 153 |
1 files changed, 79 insertions, 74 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 23d3f3f77e8..21d61d7712c 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -701,36 +701,38 @@ sub do_install_packages { install_packages($tlpdb,$localtlpdb,\@what,\@netarchs,$vars{'option_src'},$vars{'option_doc'}); } + # do_postinst_stuff has to fix up the texmf tree and install some missing # files. The things to do are taken from the install-live.sh installer # of former times, and should be critically checked. sub do_postinst_stuff { + my $TEXDIR="$vars{'TEXDIR'}"; + my $TEXMFSYSVAR="$vars{'TEXMFSYSVAR'}"; + # install some copies from texmf(-dist) into texmf-var - copy ("$vars{'TEXDIR'}/texmf-dist/tex/plain/config/language.def", - "$vars{'TEXMFSYSVAR'}/tex/plain/config") - if (-f "$vars{'TEXDIR'}/texmf-dist/tex/plain/config/language.def"); - copy ("$vars{'TEXDIR'}/texmf/xdvi/XDvi", - "$vars{'TEXMFSYSVAR'}/xdvi") - if (-f "$vars{'TEXDIR'}/texmf/xdvi/XDvi"); + copy ("$TEXDIR/texmf-dist/tex/plain/config/language.def", + "$TEXMFSYSVAR/tex/plain/config") + if (-f "$TEXDIR/texmf-dist/tex/plain/config/language.def"); + copy ("$TEXDIR/texmf/xdvi/XDvi", + "$TEXMFSYSVAR/xdvi") + if (-f "$TEXDIR/texmf/xdvi/XDvi"); # those files must exist - copy ("$vars{'TEXDIR'}/texmf/dvips/config/config.ps", - "$vars{'TEXMFSYSVAR'}/dvips/config"); - copy ("$vars{'TEXDIR'}/texmf/dvipdfm/config/config", - "$vars{'TEXMFSYSVAR'}/dvipdfm/config"); - copy ("$vars{'TEXDIR'}/texmf/web2c/mktex.cnf", - "$vars{'TEXMFSYSVAR'}/web2c"); + copy ("$TEXDIR/texmf/dvips/config/config.ps", + "$TEXMFSYSVAR/dvips/config"); + copy ("$TEXDIR/texmf/dvipdfm/config/config", + "$TEXMFSYSVAR/dvipdfm/config"); + copy ("$TEXDIR/texmf/web2c/mktex.cnf", + "$TEXMFSYSVAR/web2c"); # the old installer copied from CDDIR, but shouldn't this be installed # in ANY case since it is in bin-pdftex??? - copy ("$vars{'TEXDIR'}/texmf/tex/generic/config/pdftexconfig.tex", - "$vars{'TEXMFSYSVAR'}/tex/generic/config"); + copy ("$TEXDIR/texmf/tex/generic/config/pdftexconfig.tex", + "$TEXMFSYSVAR/tex/generic/config"); # old installer did this, should we do this, TOO???? #cp $CDDIR/texmf-dist/tex/context/config/cont-usr.tex $TEXMFSYSVAR/tex/context/config/cont-usr.tex - - # do_texmf_cnf(); @@ -740,83 +742,85 @@ sub do_postinst_stuff { # - add the bin dir to the PATH # - select perl interpreter and set the correct perllib # - run the programs - # + # Step 1: Clean the environment - my @TMFVARS = qw(VARTEXFONTS TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR + my @TMFVARS=qw(VARTEXFONTS TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFHOME TEXMFVAR TEXMFCONFIG TEXMF SYSTEXMF VARTEXFONTS TEXMFDBS WEB2C TEXINPUTS TEXFORMATS MFBASES MPMEMS TEXPOOL MFPOOL MPPOOL PSHEADERS TEXFONTMAPS TEXPSHEADERS TEXCONFIG TEXMFCNF); + foreach my $tmv (@TMFVARS) { - $ENV{$tmv} = undef if (defined($ENV{$tmv})); + $ENV{$tmv}=undef if (defined($ENV{$tmv})); } - # Step 2: Setup the PATH - my $path = ""; - if (defined($ENV{'PATH'})) { - $path = $ENV{'PATH'}; + + # Step 2: Setup the PATH, PATHEXT, switch to the new Perl + + my $pathsep=(win32)? ';' : ':'; + my $plat_bindir="$TEXDIR/bin/$vars{'this_platform'}"; + my $perl_bindir="$TEXDIR/tlpkg/tlperl/bin"; + my $perl_libdir="$TEXDIR/tlpkg/tlperl/lib"; + + tllog($::LOG_NORMAL, "Prepending $plat_bindir to PATH\n"); + + $ENV{'PATH'}="$plat_bindir" . "$pathsep" . "$ENV{'PATH'}"; + + if (win32) { + tllog($::LOG_NORMAL, "Prepending $perl_bindir to PATH\n"); + $ENV{'PATH'}="$perl_bindir" . "$pathsep" . "$ENV{'PATH'}"; } - if (win32()) { - $path = "$vars{'TEXDIR'}/bin/$vars{'this_platform'};$path"; - } else { - $path = "$vars{'TEXDIR'}/bin/$vars{'this_platform'}:$path"; + + tllog($::LOG_NORMAL, "\nNew PATH is now:\n"); + foreach my $dir (split $pathsep, $ENV{'PATH'}) { + tllog($::LOG_NORMAL, " $dir\n"); } - tllog($::LOG_NORMAL,"Setting PATH to $path\n"); - $ENV{'PATH'} = "$path"; - # Step 3: Make Perl find the right modules - if (win32()) { - # we are working with our version of perl - # thus, we have to set the PERLLIB envvar right - #my $perllib = ""; - #if (defined($ENV{'PERL5LIB'})) { - # $perllib = $ENV{'PERL5LIB'}; - #} - #$perllib .= ";$vars{'TEXDIR'}/tlpkg/tlperl/lib"; - #$ENV{'PERL5LIB'} = $perllib; - $ENV{'PERL5LIB'} = "$vars{'TEXDIR'}/tlpkg/tlperl/lib"; + tllog($::LOG_NORMAL, "\n"); + + if (win32) { + $ENV{'PATHEXT'}=".texlua;" . "$ENV{'PATHEXT'}"; + $ENV{'PERL5LIB'}="$perl_libdir"; } - # + + # Step 4: run the programs - # how hackish: on windows it is hard to find the perl scripts ... - my $perlint = (win32() ? "$vars{'TEXDIR'}/tlpkg/tlperl/bin/perl.exe" : ""); - # for arch != win32 $perlint is empty so the usual perl invocation is done - if (win32()) { - tllog($::LOG_NORMAL, "running ${perlint} $vars{'TEXDIR'}/tlpkg/bin/generate-fmtutil\n"); - `"${perlint}" "$vars{'TEXDIR'}/tlpkg/bin/generate-fmtutil"`; - tllog($::LOG_NORMAL, "running ${perlint} $vars{'TEXDIR'}/tlpkg/bin/generate-updmap\n"); - `"${perlint}" "$vars{'TEXDIR'}/tlpkg/bin/generate-updmap"`; - tllog($::LOG_NORMAL, "running ${perlint} $vars{'TEXDIR'}/tlpkg/bin/generate-language\n"); - `"${perlint}" "$vars{'TEXDIR'}/tlpkg/bin/generate-language"`; + + + tllog($::LOG_NORMAL, + "running perl $TEXDIR/tlpkg/bin/generate-fmtutil\n"); + system('perl', "$TEXDIR/tlpkg/bin/generate-fmtutil"); + + tllog($::LOG_NORMAL, + "running perl $TEXDIR/tlpkg/bin/generate-updmap\n"); + system('perl', "$TEXDIR/tlpkg/bin/generate-updmap"); + + tllog($::LOG_NORMAL, + "running perl $TEXDIR/tlpkg/bin/generate-language\n"); + system('perl', "$TEXDIR/tlpkg/bin/generate-language"); + + tllog($::LOG_NORMAL, "running mktexlsr $TEXDIR/texmf-dist " . + "$TEXDIR/texmf $TEXDIR/texmf-local\n"); + system('mktexlsr', "$TEXDIR/texmf-dist", "$TEXDIR/texmf", + "$TEXDIR/texmf-local"); + + if (win32) { + tllog($::LOG_NORMAL, "running updmap-sys\n"); + system('updmap-sys.texlua', '--nohash'); } else { - tllog($::LOG_NORMAL, "running $vars{'TEXDIR'}/tlpkg/bin/generate-fmtutil\n"); - `"$vars{'TEXDIR'}/tlpkg/bin/generate-fmtutil"`; - tllog($::LOG_NORMAL, "running $vars{'TEXDIR'}/tlpkg/bin/generate-updmap\n"); - `"$vars{'TEXDIR'}/tlpkg/bin/generate-updmap"`; - tllog($::LOG_NORMAL, "running $vars{'TEXDIR'}/tlpkg/bin/generate-language\n"); - `"$vars{'TEXDIR'}/tlpkg/bin/generate-language"`; - } - tllog($::LOG_NORMAL, "running mktexlsr $vars{'TEXDIR'}/texmf-dist $vars{'TEXDIR'}/texmf $vars{'TEXDIR'}/texmf-local\n"); - `mktexlsr "$vars{'TEXDIR'}/texmf-dist" "$vars{'TEXDIR'}/texmf" "$vars{'TEXDIR'}/texmf-local"`; - # my $updmap = (win32() ? "$perlint $vars{'TEXDIR'}/bin/win32/updmap-sys.pl" : "updmap-sys"); - # `$updmap --nohash`; - # we hope that the updmap-sys.texlua is executed ... - # but to be sure we set the PATHEXT ... - if (win32()) { - my $pathext = $ENV{'PATHEXT'}; - $pathext .= ";.texlua"; - $ENV{'PATHEXT'} = $pathext; + tllog($::LOG_NORMAL, "running updmap-sys\n"); + system('updmap-sys', '--nohash'); } - tllog($::LOG_NORMAL, "running updmap-sys\n"); - `updmap-sys --nohash`; - tllog($::LOG_NORMAL, "re-running mktexlsr $vars{'TEXMFSYSVAR'}\n"); - `mktexlsr "$vars{'TEXMFSYSVAR'}"`; + tllog($::LOG_NORMAL, "re-running mktexlsr $TEXMFSYSVAR\n"); + system('mktexlsr', "$TEXMFSYSVAR"); # old installer: #$config && texconfig-sys init #$config || echo "PLEASE RUN texconfig or texconfig-sys to make new formats." } + # we have to adjust the texmf.cnf file to the paths set in the configuration! sub do_texmf_cnf { - open(TMF,"<$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") or die("Huu, hasn't $vars{'TEXDIR'}/texmf/web2c/texmf.cnf not been installed?\n"); + open(TMF,"<$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") + or die("$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!\n"); my @texmfcnflines = <TMF>; close(TMF); my @newtmf; @@ -854,7 +858,8 @@ sub do_texmf_cnf { push @newtmf, $line; } } - open(TMF,">$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") or die("Huu, cannot open $vars{'TEXDIR'}/texmf/web2c/texmf.cnf for writing: $!\n"); + open(TMF,">$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") + or die("Can't open $vars{'TEXDIR'}/texmf/web2c/texmf.cnf for writing: $!\n"); foreach (@newtmf) { print TMF; } close(TMF); } |