diff options
author | Karl Berry <karl@freefriends.org> | 2014-11-23 18:05:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-11-23 18:05:32 +0000 |
commit | bf026a233643ee44ad14a8dcdc7a003f10b3af7b (patch) | |
tree | 8c78d177d07b199c764a79b0e4cd61f5477d7986 /Master/install-tl | |
parent | 9e696bd1663d7bd2f02ab39e0e22b63459100a9f (diff) |
* install-tl (run_postinst_cmd): new fn.
(do_postinst_stuff): call it; accumulate error count.
* TLUtils.pm (wsystem): call system and warn if failure.
* tl-update-tlnet: reimplement --no-consistency.
git-svn-id: svn://tug.org/texlive/trunk@35647 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl')
-rwxr-xr-x | Master/install-tl | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/Master/install-tl b/Master/install-tl index 31ae2249b91..732e1199c01 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -48,7 +48,7 @@ use Pod::Usage; use TeXLive::TLUtils qw(platform platform_desc sort_archs which getenv win32 unix info log debug tlwarn ddebug tldie - get_system_tmpdir member process_logging_options rmtree + get_system_tmpdir member process_logging_options rmtree wsystem mkdirhier make_var_skeleton make_local_skeleton install_package copy install_packages dirname setup_programs native_slashify forward_slashify); use TeXLive::TLPOBJ; @@ -787,11 +787,27 @@ sub do_installation { return $errcount; } +sub run_postinst_cmd { + my ($cmd) = @_; + + info ("running $cmd ..."); + my ($out,$ret) = TeXLive::TLUtils::run_cmd ("$cmd 2>&1"); + info ("done\n"); + log ($out); + + if ($ret != 0) { + tlwarn ("$0: $cmd failed: $!\n"); + $ret = 1; # be sure we don't overflow the sum on anything crazy + } + + return $ret; +} + # # Make texmf.cnf, backup directory, cleanups, path setting, and # (most importantly) post-install subprograms: mktexlsr, fmtutil, -# and more. Return count of errors detected, or zero. +# and more. Return count of errors detected, hopefully zero. sub do_postinst_stuff { my $TEXDIR = "$vars{'TEXDIR'}"; my $TEXMFSYSVAR = "$vars{'TEXMFSYSVAR'}"; @@ -831,7 +847,7 @@ sub do_postinst_stuff { if (defined($ENV{'TEXMFCNF'})) { 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 +We will unset it for the post-install actions, but all further operations might be disturbed.\n\n"; } foreach $tmv (@TMFVARS) { @@ -870,8 +886,8 @@ operations might be disturbed.\n\n"; my $usedtlpdb = $vars{'in_place'} ? $tlpdb : $localtlpdb; if (win32()) { - debug "Actual environment:\n".`set`."\n\n"; - debug 'Effective TEXMFCNF: '.`kpsewhich -expand-path=\$TEXMFCNF`."\n"; + debug("Actual environment:\n" . `set` ."\n\n"); + debug("Effective TEXMFCNF: " . `kpsewhich -expand-path=\$TEXMFCNF` ."\n"); } if (win32() and !$vars{'portable'} and !$vars{'in_place'}) { @@ -882,11 +898,9 @@ operations might be disturbed.\n\n"; # Step 4: run the programs my $errcount = 0; - # xxxx errcount -- check all these things and add any errors. if (!$vars{'in_place'}) { - info("running mktexlsr $TEXDIR/texmf-dist ...\n"); - system('mktexlsr', "$TEXDIR/texmf-dist"); + $errcount += wsystem("running", 'mktexlsr', "$TEXDIR/texmf-dist"); } # we have to generate the various config file. That could be done with @@ -919,46 +933,38 @@ operations might be disturbed.\n\n"; "$TEXMFSYSVAR/tex/generic/config/language.dat.lua", "$TEXMFLOCAL/tex/generic/config/language-local.dat.lua"); - info("running mktexlsr $TEXMFSYSVAR $TEXMFSYSCONFIG $TEXDIR/texmf-dist ...\n"); - system("mktexlsr", $TEXMFSYSVAR, $TEXMFSYSCONFIG, "$TEXDIR/texmf-dist"); + $errcount += wsystem("running", "mktexlsr", + $TEXMFSYSVAR, $TEXMFSYSCONFIG, "$TEXDIR/texmf-dist"); - info("running updmap-sys..."); - # system('updmap-sys', '--nohash'); - log(`updmap-sys --nohash 2>&1`); - info("done\n"); + $errcount += run_postinst_cmd("updmap-sys --nohash"); # now work through the options if specified at all # letter instead of a4 if ($vars{'option_letter'}) { - # set paper size, but do not execute any post actions, in this case - # it would be: - # - mktexlsr - # - fmtutil-sys -all - info("setting default paper size to letter\n"); - log(`tlmgr --no-execute-actions paper letter 2>&1`); + # set paper size, but do not execute any post actions, which in this + # case would be mktexlsr and fmtutil-sys -all; clearly premature + # here in the installer. + info("setting default paper size to letter:\n"); + $errcount += run_postinst_cmd("tlmgr --no-execute-actions paper letter"); } # now rerun mktexlsr for updmap-sys and tlmgr paper letter updates. - info("re-running mktexlsr $TEXMFSYSVAR $TEXMFSYSCONFIG...\n"); - system("mktexlsr", $TEXMFSYSVAR, $TEXMFSYSCONFIG); + $errcount += wsystem("re-running", "mktexlsr", $TEXMFSYSVAR,$TEXMFSYSCONFIG); - # luatex/context + # luatex/context setup. if (exists($install{"context"}) && $install{"context"} == 1 && !exists $ENV{"TEXLIVE_INSTALL_NO_CONTEXT_CACHE"}) { - info("setting up ConTeXt MkIV cache with mtxrun --generate ..."); - system('mtxrun', '--generate'); - info("done\n"); + info("setting up ConTeXt cache:\n"); + $errcount += run_postinst_cmd("mtxrun --generate"); } # all formats option if ($vars{'option_fmt'}) { - info("pre-generating all format files (fmtutil-sys --all), be patient..."); - log(`fmtutil-sys $common_fmtutil_args --all 2>&1`); - info("done\n"); + info("pre-generating all format files, be patient...\n"); + $errcount += run_postinst_cmd("fmtutil-sys $common_fmtutil_args --all"); } - # # do path adjustments: On Windows add/remove to PATH etc, # on Unix set symlinks # for portable, this option should be unset @@ -987,12 +993,12 @@ sub do_tlpdb_postactions { my $usedtlpdb = $vars{'in_place'} ? $tlpdb : $localtlpdb; foreach my $package ($usedtlpdb->list_packages) { - &TeXLive::TLUtils::do_postaction("install", - $usedtlpdb->get_package($package), - $vars{'option_file_assocs'}, - $vars{'option_menu_integration'}, - $vars{'option_desktop_integration'}, - $vars{'option_post_code'}); + TeXLive::TLUtils::do_postaction("install", + $usedtlpdb->get_package($package), + $vars{'option_file_assocs'}, + $vars{'option_menu_integration'}, + $vars{'option_desktop_integration'}, + $vars{'option_post_code'}); } info ("finished with package-specific postactions\n"); |