diff options
author | Norbert Preining <preining@logic.at> | 2009-02-22 22:25:23 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-02-22 22:25:23 +0000 |
commit | 56352c1e0c78d9beb783e1dd3570f62ac63adf09 (patch) | |
tree | dd7d65c029be20bd5cf8998a4af3bacedd8a74ff /Master/install-tl | |
parent | 3af42cf0716b8192f6447186b042ea909075a056 (diff) |
work on 2009, integrating 2009.combined patch, and starting
work on the postaction code support
git-svn-id: svn://tug.org/texlive/branches/branch2009-dev@12213 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-x | Master/install-tl | 662 |
1 files changed, 324 insertions, 338 deletions
diff --git a/Master/install-tl b/Master/install-tl index 46f01769977..72e0454046a 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -82,7 +82,6 @@ if (win32) { &add_menu_shortcut &remove_desktop_shortcut &remove_menu_shortcut - &init_unshortbat &create_uninstaller )); } @@ -121,7 +120,7 @@ our @collections_lang_doc; # # The following values are taken from the remote tlpdb using the # $tlpdb->option_XXXXX -# settings (i.e., taken from tlpkg/tlpsrc/00texlive-installation.tlpsrc +# settings (i.e., taken from tlpkg/tlpsrc/00texlive.installation.tlpsrc # # 'option_symlinks' => 0, # 'sys_bin' => '/usr/local/bin', @@ -146,7 +145,7 @@ our %vars=( # 'n_' means 'number of'. # option handling my $opt_from_dvd = ""; -my $opt_gui = (win32() ? "perltk" : "text"); +my $opt_gui = (win32() ? "wizard" : "text"); my $opt_help = 0; my $opt_location = ""; my $opt_no_gui = 0; @@ -380,6 +379,14 @@ if (($media eq "NET") || ($media eq "CD")) { $vars{'doc_splitting_supported'} = $tlpdb->config_doc_container; } $texlive_release = $tlpdb->config_release; +# 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 +# might use +# release/2009-foobar +if ($texlive_release !~ m/^$TeXLive::TLConfig::ReleaseYear/) { + die "The release version of the installation source and\nthe installation media do not agree:\nsource: $texlive_release\nmedia: $TeXLive::TLConfig::ReleaseYear\nPlease report to tex-live\@tug.org"; +} set_platforms_supported(); set_texlive_default_dirs(); initialize_collections(); @@ -491,7 +498,229 @@ sub do_installation { save_options_into_tlpdb(); do_install_packages(); } + # now we save every scheme that is fully covered by the stuff we have + # installed to the $localtlpdb + foreach my $s ($tlpdb->schemes) { + my $stlp = $tlpdb->get_package($s); + die ("That cannot happen, $s not defined in tlpdb") unless defined($stlp); + my $incit = 1; + foreach my $d ($stlp->depends) { + if (!defined($localtlpdb->get_package($d))) { + $incit = 0; + last; + } + } + if ($incit) { + $localtlpdb->add_tlpobj($stlp); + } + } + $localtlpdb->save unless $vars{'from_dvd'}; + do_postinst_stuff(); +} + +# 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 $TEXDIRW="$vars{'TEXDIRW'}"; + my $TEXMFSYSVAR="$vars{'TEXMFSYSVAR'}"; + my $TEXMFSYSCONFIG="$vars{'TEXMFSYSCONFIG'}"; + my $TEXMFLOCAL="$vars{'TEXMFLOCAL'}"; + my $tmv; + + do_texmf_cnf() unless ($opt_portable); + + + # final program execution + # we have to do several things: + # - clean the environment from spurious TEXMF related variables + # - add the bin dir to the PATH + # - select perl interpreter and set the correct perllib + # - run the programs + + # Step 1: Clean the environment + 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 + TEXMFHOME TEXMFVAR TEXMFCONFIG); + + if (defined($ENV{'TEXMFCNF'}) and !$vars{'from_dvd'} and !$opt_portable) { + 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 +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})); + } + } + $ENV{'TEXMFSYSVAR'} = $vars{'TEXMFSYSVAR'} if $vars{'from_dvd'}; + + # Step 2: Setup the PATH, 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"; + +## This won't do any good; +## have to remove other tex directories in calling batchfile +# if (win32) { +# debug("Removing other TeXs from path\n"); +# my @newpt = (); +# foreach my $d (split (';', $ENV{'PATH'})) { +# push @newpt, $d unless TeXLive::TLWinGoo::is_a_texdir($d); +# } +# $ENV{'PATH'} = join($pathsep, @newpt); +# debug("Path after removals(s):\n $ENV{'PATH'}\n"); +# } + + debug("Prepending $plat_bindir to PATH\n"); + + $ENV{'PATH'}="$plat_bindir" . "$pathsep" . "$ENV{'PATH'}"; + + if (win32) { + debug("Prepending $perl_bindir to PATH\n"); + $ENV{'PATH'}="$perl_bindir" . "$pathsep" . "$ENV{'PATH'}"; + $ENV{'PATH'} =~ s!/!\\!g; + } + + debug("\nNew PATH is now:\n"); + foreach my $dir (split $pathsep, $ENV{'PATH'}) { + debug(" $dir\n"); + } + debug("\n"); + + if (win32) { + $ENV{'PERL5LIB'}="$perl_libdir"; + } + + # + # post install actions + # + + # in case we are running from DVD we use the tlpdb from the DVD, otherwise + # the one we have locally created, for all the further actions + my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb; + + + if (win32()) { + debug "Actual environment:\n".`set`."\n\n"; + debug 'Effective TEXMFCNF: '.`kpsewhich -expand-path=\$TEXMFCNF`."\n"; + } + + # TODO: can the following two clauses be merged? + if (win32()) { + create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'}, + $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'}); + } + # (re-)initialize batchfile for uninstalling shortcuts + if (win32() and !$opt_portable) { + mkdirhier("$TEXDIRW/tlpkg/installer") if $vars{'from_dvd'}; + } + + # Step 4: run the programs + + if (!$opt_portable and !$vars{'from_dvd'}) { + info("running mktexlsr $TEXDIR/texmf-dist $TEXDIR/texmf\n"); + system('mktexlsr', "$TEXDIR/texmf-dist", "$TEXDIR/texmf"); + } + + # we have to generate the various config file. That could be done with + # texconfig generate * but Win32 does not have texconfig. But we have + # $localtlpdb and this is simple code, so do it directly, i.e., duplicate + # the code from the various generate-*.pl scripts + + info("writing fmtutil.cnf data to $TEXMFSYSVAR/web2c/fmtutil.cnf\n"); + TeXLive::TLUtils::create_fmtutil($usedtlpdb, + "$TEXMFSYSVAR/web2c/fmtutil.cnf", + "$TEXMFLOCAL/web2c/fmtutil-local.cnf"); + + mkdirhier "$vars{'TEXMFSYSCONFIG'}/web2c"; + info("writing updmap.cfg to $TEXMFSYSCONFIG/web2c/updmap.cfg\n"); + TeXLive::TLUtils::create_updmap ($usedtlpdb, + "$TEXMFSYSCONFIG/web2c/updmap.cfg", + "$TEXMFLOCAL/web2c/updmap-local.cfg"); + + info("writing language.dat data to $TEXMFSYSVAR/tex/generic/config/language.dat\n"); + TeXLive::TLUtils::create_language_dat($usedtlpdb, + "$TEXMFSYSVAR/tex/generic/config/language.dat", + "$TEXMFLOCAL/tex/generic/config/language-local.dat"); + + info("writing language.def data to $TEXMFSYSVAR/tex/generic/config/language.def\n"); + TeXLive::TLUtils::create_language_def($usedtlpdb, + "$TEXMFSYSVAR/tex/generic/config/language.def", + "$TEXMFLOCAL/tex/generic/config/language-local.def"); + + info("running mktexlsr $TEXMFSYSVAR\n"); + system('mktexlsr', "$TEXMFSYSVAR"); + + info("running updmap-sys... "); + # system('updmap-sys', '--nohash'); + log(`updmap-sys --nohash 2>&1`); + info("done\n"); + + info("re-running mktexlsr $TEXMFSYSVAR\n"); + system('mktexlsr', "$TEXMFSYSVAR"); + + # now work through the options if specified at all + + # letter instead of a4 + if ($vars{'option_letter'}) { + info("Setting default paper size to letter\n"); + system("tlmgr", "paper", "letter"); + } + + # all formats option + if ($vars{'option_fmt'}) { + info("pre-generating all format files (fmtutil-sys --all), be patient..."); + log(`fmtutil-sys --all 2>&1`); + info("done\n"); + } + + # TODO: Should/can this be moved into the do_system_integration part? + # it looks like it does not do anything outside the texlive tree, so it + # would be fine if we do it anyway ... + # $opt_portable: no %install but we still want xetex postinstall + &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL) + if $opt_portable; + + # no do the system integration: + # on unix this means setting up symlinks + # on w32 this means adding to path, settting registry values + # on both, we run the TLPostActions and the postaction directives of the tlp + do_system_integration() if $vars{'option_sysint'}; +} + +sub do_system_integration { + # Run the post installation code in TLPostAction.pm + foreach my $package (sort keys %install) { + if ($install{$package} && defined($PostInstall{$package})) { + info("running post install action for $package\n"); + &{$PostInstall{$package}}($vars{'TEXDIR'}, $vars{'TEXDIRW'}, + $vars{'TEXMFSYSVAR'}, $vars{'TEXMFLOCAL'}); + } + } + # Run the post installation code in the postaction tlpsrc entries + my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb; + foreach my $package (sort keys %install) { + if ($install{$package}) { + &TeXLive::TLUtils::do_postaction_code("install", + $usedtlpdb->get_package($package)); + } + } + info ("finished with package specific postactions\n"); + if (win32()) { + update_assocs(); + my $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'}; $path =~ s/[\s\x00]+$//; log("Old system path: $path\n"); @@ -516,29 +745,97 @@ sub do_installation { # setenv_reg('TEXMFSYSVAR', $vars{'TEXMFSYSVAR'}) if $vars{'from_dvd'}; setenv_reg('TEXMFCNF', $vars{'TEXMFSYSVAR'}.'/web2c') if $vars{'from_dvd'}; broadcast_env(); - create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'}, - $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'}); + } else { + $localtlpdb->add_symlinks() } - do_postinst_stuff(); - # now we save every scheme that is fully covered by the stuff we have - # installed to the $localtlpdb - foreach my $s ($tlpdb->schemes) { - my $stlp = $tlpdb->get_package($s); - die ("That cannot happen, $s not defined in tlpdb") unless defined($stlp); - my $incit = 1; - foreach my $d ($stlp->depends) { - if (!defined($localtlpdb->get_package($d))) { - $incit = 0; - last; +} + + +# 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 "$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!"; + my @texmfcnflines = <TMF>; + close(TMF); + my @newtmf; + my @changedtmf; + # we have to find TEXMFLOCAL TEXMFSYSVAR and TEXMFHOME + foreach my $line (@texmfcnflines) { + if ($line =~ m/^TEXMFLOCAL/) { + # by default TEXMFLOCAL = TEXDIR/../texmf-local, if this is the case + # we don't have to change anything from the default + my $deftmlocal = dirname($vars{'TEXDIR'}); + $deftmlocal .= "/texmf-local"; + if ("$vars{'TEXMFLOCAL'}" eq "$deftmlocal") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; + push @changedtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; } - } - if ($incit) { - $localtlpdb->add_tlpobj($stlp); + } elsif ($line =~ m/^TEXMFSYSVAR/) { + # by default TEXMFSYSVAR = TEXDIR/texmf-var, if this is the case + # we don't have to change anything from the default + if ("$vars{'TEXMFSYSVAR'}" eq "$vars{'TEXDIR'}/texmf-var") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; + push @changedtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; + } + } elsif ($line =~ m/^TEXMFSYSCONFIG/) { + # by default TEXMFSYSCONFIG = TEXDIR/texmf-config, if this is the case + # we don't have to change anything from the default + if ("$vars{'TEXMFSYSCONFIG'}" eq "$vars{'TEXDIR'}/texmf-config") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; + push @changedtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; + } + } elsif ($line =~ m/^TEXMFHOME/) { + # kpse now expands ~ to USERPROFILE, so we don't treat win32 and + # unix differently + push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; + if ("$vars{'TEXMFHOME'}" ne "~/texmf") { + push @changedtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; + } + } elsif ($line =~ m/^OSFONTDIR/) { + if (win32()) { + push @newtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; + push @changedtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; + } else { + push @newtmf, $line; + } + } else { + push @newtmf, $line; } } - $localtlpdb->save unless $vars{'from_dvd'}; + my $TMF; + if (!$vars{'from_dvd'}) { + $TMF = ">$vars{'TEXDIR'}/texmf.cnf"; + open(TMF, $TMF) || die "open($TMF) failed: $!"; + print TMF <<EOF; +% This texmf.cnf file should contain only your personal changes from the +% main texmf.cnf. +% +% Do NOT change values in the main file (which is in +% .../texlive/YYYY/texmf/web2c/texmf.cnf), as YOUR CHANGES WILL BE LOST +% by later updates. +% +% If you need to make changes to texmf.cnf, put your custom settings in +% this file instead, which is YYYY/texmf.cnf. And insert *only* your +% changed values. +% +EOF +; + foreach (@changedtmf) { print TMF; } + } else { + $TMF = ">$vars{'TEXMFSYSVAR'}/web2c/texmf.cnf"; + open (TMF, $TMF) || die "open($TMF) failed: $!\n"; + foreach (@newtmf) { print TMF; } + } + close(TMF) || warn "close($TMF) failed: $!"; } + sub dump_vars { my $filename=shift; my $fh; @@ -744,7 +1041,10 @@ sub load_tlpdb { $vars{'option_fmt'} = $tlpdb->option_create_formats; $vars{'option_letter'} = defined($tlpdb->option_paper) && ($tlpdb->option_paper eq "letter" ? 1 : 0); - $vars{'option_symlinks'} = $tlpdb->option_create_symlinks; + $vars{'option_sysint'} = $tlpdb->option_system_integration; + if (win32()) { + $vars{'option_sysint'} = 1; + } $vars{'sys_bin'} = $tlpdb->option_sys_bin; $vars{'sys_man'} = $tlpdb->option_sys_man; $vars{'sys_info'} = $tlpdb->option_sys_info; @@ -850,8 +1150,8 @@ sub create_profile { print $fh "$key $vars{$key}\n" if $key=~/^option_doc/; print $fh "$key $vars{$key}\n" if $key=~/^option_fmt/; print $fh "$key $vars{$key}\n" if $key=~/^option_src/; - print $fh "$key $vars{$key}\n" if $key=~/^option_symlinks/; - if ($vars{'option_symlinks'}) { + print $fh "$key $vars{$key}\n" if $key=~/^option_sysint/; + if ($vars{'option_sysint'} && unix()) { print $fh "sys_bin ", $vars{'sys_bin'}, "\n" if $key =~ /^sys_bin/; print $fh "sys_man ", $vars{'sys_man'}, "\n" if $key =~ /^sys_man/; print $fh "sys_info ", $vars{'sys_info'}, "\n" if $key =~ /^sys_info/; @@ -948,7 +1248,7 @@ sub save_options_into_tlpdb { $localtlpdb->option_location($location); $localtlpdb->option_paper($vars{'option_letter'} ? "letter" : "a4"); $localtlpdb->option_create_formats($vars{'option_fmt'} ? "1" : "0"); - $localtlpdb->option_create_symlinks($vars{'option_symlinks'} ? "1" : "0"); + $localtlpdb->option_system_integration($vars{'option_sysint'} ? "1" : "0"); $localtlpdb->option_sys_bin($vars{'sys_bin'}); $localtlpdb->option_sys_info($vars{'sys_info'}); $localtlpdb->option_sys_man($vars{'sys_man'}); @@ -964,320 +1264,6 @@ sub save_options_into_tlpdb { $localtlpdb->save() unless $vars{'from_dvd'}; } -# 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 $TEXDIRW="$vars{'TEXDIRW'}"; - my $TEXMFSYSVAR="$vars{'TEXMFSYSVAR'}"; - my $TEXMFSYSCONFIG="$vars{'TEXMFSYSCONFIG'}"; - my $TEXMFLOCAL="$vars{'TEXMFLOCAL'}"; - my $tmv; - - do_texmf_cnf() unless ($opt_portable); - - - # final program execution - # we have to do several things: - # - clean the environment from spurious TEXMF related variables - # - add the bin dir to the PATH - # - select perl interpreter and set the correct perllib - # - run the programs - - # Step 1: Clean the environment - 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 - TEXMFHOME TEXMFVAR TEXMFCONFIG); - - if (defined($ENV{'TEXMFCNF'}) and !$vars{'from_dvd'} and !$opt_portable) { - 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 -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})); - } - } - $ENV{'TEXMFSYSVAR'} = $vars{'TEXMFSYSVAR'} if $vars{'from_dvd'}; - - # Step 2: Setup the PATH, 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"; - -## This won't do any good; -## have to remove other tex directories in calling batchfile -# if (win32) { -# debug("Removing other TeXs from path\n"); -# my @newpt = (); -# foreach my $d (split (';', $ENV{'PATH'})) { -# push @newpt, $d unless TeXLive::TLWinGoo::is_a_texdir($d); -# } -# $ENV{'PATH'} = join($pathsep, @newpt); -# debug("Path after removals(s):\n $ENV{'PATH'}\n"); -# } - - debug("Prepending $plat_bindir to PATH\n"); - - $ENV{'PATH'}="$plat_bindir" . "$pathsep" . "$ENV{'PATH'}"; - - if (win32) { - debug("Prepending $perl_bindir to PATH\n"); - $ENV{'PATH'}="$perl_bindir" . "$pathsep" . "$ENV{'PATH'}"; - $ENV{'PATH'} =~ s!/!\\!g; - } - - debug("\nNew PATH is now:\n"); - foreach my $dir (split $pathsep, $ENV{'PATH'}) { - debug(" $dir\n"); - } - debug("\n"); - - if (win32) { - $ENV{'PERL5LIB'}="$perl_libdir"; - } - - # - # post install actions - # - - if (win32()) { - debug "Actual environment:\n".`set`."\n\n"; - debug 'Effective TEXMFCNF: '.`kpsewhich -expand-path=\$TEXMFCNF`."\n"; - } - - # (re-)initialize batchfile for uninstalling shortcuts - if (win32() and !$opt_portable) { - mkdirhier("$TEXDIRW/tlpkg/installer") if $vars{'from_dvd'}; - init_unshortbat($TEXDIRW); - } - - foreach my $package (sort keys %install) { - if ($install{$package} && defined($PostInstall{$package})) { - info("running post install action for $package\n"); - &{$PostInstall{$package}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL); - } - } - # $opt_portable: no %install but we still want xetex postinstall - &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL) - if $opt_portable; - update_assocs() if win32(); - - # Step 4: run the programs - - if (!$opt_portable and !$vars{'from_dvd'}) { - info("running mktexlsr $TEXDIR/texmf-dist $TEXDIR/texmf\n"); - system('mktexlsr', "$TEXDIR/texmf-dist", "$TEXDIR/texmf"); - } - - # we have to generate the various config file. That could be done with - # texconfig generate * but Win32 does not have texconfig. But we have - # $localtlpdb and this is simple code, so do it directly, i.e., duplicate - # the code from the various generate-*.pl scripts - info("writing fmtutil.cnf data to $TEXMFSYSVAR/web2c/fmtutil.cnf\n"); - my $tlp = $vars{'from_dvd'} ? $tlpdb : $localtlpdb; - TeXLive::TLUtils::create_fmtutil($tlp, #$localtlpdb, - "$TEXMFSYSVAR/web2c/fmtutil.cnf", - "$TEXMFLOCAL/web2c/fmtutil-local.cnf"); - - mkdirhier "$vars{'TEXMFSYSCONFIG'}/web2c"; - info("writing updmap.cfg to $TEXMFSYSCONFIG/web2c/updmap.cfg\n"); - TeXLive::TLUtils::create_updmap ($tlp, #$localtlpdb, - "$TEXMFSYSCONFIG/web2c/updmap.cfg", - "$TEXMFLOCAL/web2c/updmap-local.cfg"); - - info("writing language.dat data to $TEXMFSYSVAR/tex/generic/config/language.dat\n"); - TeXLive::TLUtils::create_language_dat($tlp, #$localtlpdb, - "$TEXMFSYSVAR/tex/generic/config/language.dat", - "$TEXMFLOCAL/tex/generic/config/language-local.dat"); - - info("writing language.def data to $TEXMFSYSVAR/tex/generic/config/language.def\n"); - TeXLive::TLUtils::create_language_def($tlp, #$localtlpdb, - "$TEXMFSYSVAR/tex/generic/config/language.def", - "$TEXMFLOCAL/tex/generic/config/language-local.def"); - - info("running mktexlsr $TEXMFSYSVAR\n"); - system('mktexlsr', "$TEXMFSYSVAR"); - - info("running updmap-sys... "); - # system('updmap-sys', '--nohash'); - log(`updmap-sys --nohash 2>&1`); - info("done\n"); - - info("re-running mktexlsr $TEXMFSYSVAR\n"); - system('mktexlsr', "$TEXMFSYSVAR"); - - # now work through the options if specified at all - - # letter instead of a4 - if ($vars{'option_letter'}) { - info("Setting default paper size to letter\n"); - if (platform() eq "hppa-hpux") { - # we didn't get a texlua binary for hppa-hpux, so try texconfig - system("texconfig", "paper", "letter"); - } else { - system("texlua", "$TEXDIR/texmf/scripts/texlive/texconf.tlu", "--sys", "--noformat", "paper", "letter"); - } - } - - # all formats option - if ($vars{'option_fmt'}) { - info("pre-generating all format files (fmtutil-sys --all), be patient..."); - #system('fmtutil-sys', '--all'); - # try to capture that output - log(`fmtutil-sys --all 2>&1`); - info("done\n"); - } - - # option_links - if ($vars{'option_symlinks'}) { - # bin files - my @files; - mkdirhier $vars{'sys_bin'}; - if (-w $vars{'sys_bin'}) { - info("linking binaries to $vars{'sys_bin'}\n"); - @files = `ls $plat_bindir`; - chomp(@files); - `cd "$vars{'sys_bin'}" && rm -f @files`; - `ln -s "$plat_bindir/"* "$vars{'sys_bin'}"`; - } else { - info("destination of bin symlink $vars{'sys_bin'} not writable, " - . "no linking of bin files done.\n"); - } - if ($vars{'option_doc'}) { - # info files - mkdirhier $vars{'sys_info'}; - if (-w $vars{'sys_info'}) { - info("linking info pages to $vars{'sys_info'}\n"); - @files = `ls "$TEXDIR/texmf/doc/info"`; - chomp(@files); - `cd "$vars{'sys_info'}" && rm -f @files`; - `ln -s "$TEXDIR/texmf/doc/info/"*info* "$vars{'sys_info'}"`; - } else { - info("destination of info symlink $vars{'sys_info'} not writable, " - . "no linking of info files done.\n"); - } - # man files - mkdirhier $vars{'sys_man'}; - if (-w $vars{'sys_man'}) { - info("linking man pages to $vars{'sys_man'}\n"); - my $foo = `(cd "$TEXDIR/texmf/doc/man" && echo *)`; - my @mans = split ' ', $foo; - chomp(@mans); - foreach my $m (@mans) { - my $mandir = "$TEXDIR/texmf/doc/man/$m"; - next unless -d $mandir; - mkdirhier "$vars{'sys_man'}/$m"; - next unless -w "$vars{'sys_man'}/$m"; - @files = `ls "$mandir"`; - chomp(@files); - `cd "$vars{'sys_man'}/$m" && rm -f @files`; - `ln -s "$mandir/"* "$vars{'sys_man'}/$m"`; - } - } else { - info("destination of man symlink $vars{'sys_man'} not writable, " - . "no linking of man files done.\n"); - } - } - } -} - - -# 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 "$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!"; - my @texmfcnflines = <TMF>; - close(TMF); - my @newtmf; - my @changedtmf; - # we have to find TEXMFLOCAL TEXMFSYSVAR and TEXMFHOME - foreach my $line (@texmfcnflines) { - if ($line =~ m/^TEXMFLOCAL/) { - # by default TEXMFLOCAL = TEXDIR/../texmf-local, if this is the case - # we don't have to change anything from the default - my $deftmlocal = dirname($vars{'TEXDIR'}); - $deftmlocal .= "/texmf-local"; - if ("$vars{'TEXMFLOCAL'}" eq "$deftmlocal") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; - push @changedtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; - } - } elsif ($line =~ m/^TEXMFSYSVAR/) { - # by default TEXMFSYSVAR = TEXDIR/texmf-var, if this is the case - # we don't have to change anything from the default - if ("$vars{'TEXMFSYSVAR'}" eq "$vars{'TEXDIR'}/texmf-var") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; - push @changedtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; - } - } elsif ($line =~ m/^TEXMFSYSCONFIG/) { - # by default TEXMFSYSCONFIG = TEXDIR/texmf-config, if this is the case - # we don't have to change anything from the default - if ("$vars{'TEXMFSYSCONFIG'}" eq "$vars{'TEXDIR'}/texmf-config") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; - push @changedtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; - } - } elsif ($line =~ m/^TEXMFHOME/) { - # kpse now expands ~ to USERPROFILE, so we don't treat win32 and - # unix differently - push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; - if ("$vars{'TEXMFHOME'}" ne "~/texmf") { - push @changedtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; - } - } elsif ($line =~ m/^OSFONTDIR/) { - if (win32()) { - push @newtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; - push @changedtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; - } else { - push @newtmf, $line; - } - } else { - push @newtmf, $line; - } - } - my $TMF; - if (!$vars{'from_dvd'}) { - $TMF = ">$vars{'TEXDIR'}/texmf.cnf"; - open(TMF, $TMF) || die "open($TMF) failed: $!"; - print TMF <<EOF; -% This texmf.cnf file should contain only your personal changes from the -% main texmf.cnf. -% -% Do NOT change values in the main file (which is in -% .../texlive/YYYY/texmf/web2c/texmf.cnf), as YOUR CHANGES WILL BE LOST -% by later updates. -% -% If you need to make changes to texmf.cnf, put your custom settings in -% this file instead, which is YYYY/texmf.cnf. And insert *only* your -% changed values. -% -EOF -; - foreach (@changedtmf) { print TMF; } - } else { - $TMF = ">$vars{'TEXMFSYSVAR'}/web2c/texmf.cnf"; - open (TMF, $TMF) || die "open($TMF) failed: $!\n"; - foreach (@newtmf) { print TMF; } - } - close(TMF) || warn "close($TMF) failed: $!"; -} - # do everything to select a scheme # sub select_scheme { |