From 1df297d584d71161b479472d60d102e11fd9b2c7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 21 Apr 2014 00:17:48 +0000 Subject: allow for luajittex not available on all platforms git-svn-id: svn://tug.org/texlive/trunk@33571 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/texlive/tl_scripts/ChangeLog | 5 ++ Build/source/texk/texlive/tl_scripts/fmtutil.sh | 21 +++++++- Master/install-tl | 6 ++- Master/texmf-dist/scripts/texlive/fmtutil.sh | 21 +++++++- Master/texmf-dist/scripts/texlive/tlmgr.pl | 71 +++++++++++++++++++++---- Master/tlpkg/TeXLive/TLConfig.pm | 5 +- 6 files changed, 114 insertions(+), 15 deletions(-) diff --git a/Build/source/texk/texlive/tl_scripts/ChangeLog b/Build/source/texk/texlive/tl_scripts/ChangeLog index 59d4589a144..c566c92ae88 100644 --- a/Build/source/texk/texlive/tl_scripts/ChangeLog +++ b/Build/source/texk/texlive/tl_scripts/ChangeLog @@ -1,3 +1,8 @@ +2014-04-21 Norbert Preining + + * fmtutil.sh: new option --no-error-if-no-engine, + for the sake of luajittex, not available on all platforms. + 2013-07-31 Norbert Preining * updmap-sys.sh: call updmap --sys instead of epanding vars diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil.sh b/Build/source/texk/texlive/tl_scripts/fmtutil.sh index f3609805be5..d4f6d4e0902 100755 --- a/Build/source/texk/texlive/tl_scripts/fmtutil.sh +++ b/Build/source/texk/texlive/tl_scripts/fmtutil.sh @@ -4,7 +4,7 @@ # Run with --help for usage. # program history: -# further changes in texk/tetex/ChangeLog. +# further changes in texk/texlive/tl_scripts/ChangeLog. # 2007-01-04 patch by JK to support $engine subdir (enabled by default) # Fr Apr 8 19:15:05 CEST 2005 cleanup now has an argument for the return code # Do Mar 02 10:42:31 CET 2006 add tmpdir to TEXFORMATS @@ -105,6 +105,9 @@ Optional behavior: --fmtdir DIRECTORY --no-engine-subdir don't use engine-specific subdir of the fmtdir --no-error-if-no-format exit successfully if no format is selected + --no-error-if-no-engine=ENGINE1,ENGINE2,... + exit successfully even if the required engine + is missing, if it is included in the list. --quiet be silent --test (not implemented, just for compatibility) --dolinks (not implemented, just for compatibility) @@ -501,6 +504,10 @@ main() cmd=listcfg;; --no-error-if-no-format) noAbortFlag=true;; + --no-error-if-no-engine) + shift; noErrorEngines=$1;; + --no-error-if-no-engine=*) + noErrorEngines=`echo "$1" | sed 's/--no-error-if-no-engine=//'`;; --quiet|-q|--silent) verboseFlag=false;; --test|--dolinks|--force) @@ -757,6 +764,18 @@ run_initex() mktexfmt_loop=$mktexfmt_loop:$format/$engine export mktexfmt_loop + # check for existence of engine and ignored setting + if `which $engine >/dev/null` ; then + : nothing to be done + else + # add additional commas at front and back and search for comma separated + # engine + if case ,$noErrorEngines, in *",$engine,"*) true ;; *) false;; esac ; then + verboseMsg "$progname: not building $format due to missing engine $engine." + return + fi + fi + verboseMsg "$progname: running \`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' ..." # run in a subshell to get a local effect of TEXPOOL manipulation: diff --git a/Master/install-tl b/Master/install-tl index c62fac5c3c7..674861aa150 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -111,6 +111,10 @@ $::run_menu = sub { die "no UI defined." ; }; # the default scheme to be installed my $default_scheme='scheme-full'; +# common fmtutil args, keep in sync with tlmgr.pl. +my $common_fmtutil_arguments = \ + "--no-error-if-no-engine=$TeXLive::TLConfig::PartialEngineSupport"; + # some arrays where the lists of collections to be installed are saved # our for menus our @collections_std; @@ -935,7 +939,7 @@ operations might be disturbed.\n\n"; # all formats option if ($vars{'option_fmt'}) { info("pre-generating all format files (fmtutil-sys --all), be patient..."); - log(`fmtutil-sys --all 2>&1`); + log(`fmtutil-sys $common_fmtutil_arguments --all 2>&1`); info("done\n"); } diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.sh b/Master/texmf-dist/scripts/texlive/fmtutil.sh index 96eeafa0567..2f96df431c7 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.sh +++ b/Master/texmf-dist/scripts/texlive/fmtutil.sh @@ -4,7 +4,7 @@ # Run with --help for usage. # program history: -# further changes in texk/tetex/ChangeLog. +# further changes in texk/texlive/tl_scripts/ChangeLog. # 2007-01-04 patch by JK to support $engine subdir (enabled by default) # Fr Apr 8 19:15:05 CEST 2005 cleanup now has an argument for the return code # Do Mar 02 10:42:31 CET 2006 add tmpdir to TEXFORMATS @@ -105,6 +105,9 @@ Optional behavior: --fmtdir DIRECTORY --no-engine-subdir don't use engine-specific subdir of the fmtdir --no-error-if-no-format exit successfully if no format is selected + --no-error-if-no-engine=ENGINE1,ENGINE2,... + exit successfully even if the required engine + is missing, if it is included in the list. --quiet be silent --test (not implemented, just for compatibility) --dolinks (not implemented, just for compatibility) @@ -501,6 +504,10 @@ main() cmd=listcfg;; --no-error-if-no-format) noAbortFlag=true;; + --no-error-if-no-engine) + shift; noErrorEngines=$1;; + --no-error-if-no-engine=*) + noErrorEngines=`echo "$1" | sed 's/--no-error-if-no-engine=//'`;; --quiet|-q|--silent) verboseFlag=false;; --test|--dolinks|--force) @@ -757,6 +764,18 @@ run_initex() mktexfmt_loop=$mktexfmt_loop:$format/$engine export mktexfmt_loop + # check for existence of engine and ignored setting + if `which $engine >/dev/null` ; then + : nothing to be done + else + # add additional commas at front and back and search for comma separated + # engine + if case ,$noErrorEngines, in *",$engine,"*) true ;; *) false;; esac ; then + verboseMsg "$progname: not building $format due to missing engine $engine." + return + fi + fi + verboseMsg "$progname: running \`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' ..." # run in a subshell to get a local effect of TEXPOOL manipulation: diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index b8bca6dc6cc..6f602d1d90f 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -111,6 +111,10 @@ our $FLAG_AUTOINSTALL = "a"; our $FLAG_INSTALL = "i"; our $FLAG_REINSTALL = "I"; +# keep in sync with install-tl. +our $common_fmtutil_args = \ + "--no-error-if-no-engine=$TeXLive::TLConfig::PartialEngineSupport"; + # option variables $::gui_mode = 0; $::machinereadable = 0; @@ -662,11 +666,11 @@ sub do_cmd_and_check # If the "map" key is specified, the value may be a reference to a list # of map command strings to pass to updmap, e.g., "enable Map=ascii.map". # -sub handle_execute_actions -{ +sub handle_execute_actions { my $errors = 0; my $sysmode = ($opts{"usermode"} ? "" : "-sys"); + my $invoke_fmtutil = "fmtutil$sysmode $common_fmtutil_args"; if ($::files_changed) { $errors += do_cmd_and_check("mktexlsr"); @@ -792,7 +796,8 @@ sub handle_execute_actions # first regenerate all formats --byengine for my $e (keys %updated_engines) { log ("updating formats based on $e\n"); - $errors += do_cmd_and_check("fmtutil$sysmode --no-error-if-no-format --byengine $e"); + $errors += do_cmd_and_check + ("$invoke_fmtutil --no-error-if-no-format --byengine $e"); } # now rebuild all other formats for my $f (keys %do_enable) { @@ -800,7 +805,7 @@ sub handle_execute_actions # ignore disabled formats next if !$::execute_actions{'enable'}{'formats'}{$f}{'mode'}; log ("(re)creating format dump $f\n"); - $errors += do_cmd_and_check("fmtutil$sysmode --byfmt $f"); + $errors += do_cmd_and_check ("$invoke_fmtutil --byfmt $f"); $done_formats{$f} = 1; } } @@ -820,7 +825,7 @@ sub handle_execute_actions } if ($localtlpdb->option("create_formats") && !$::regenerate_all_formats) { - $errors += do_cmd_and_check("fmtutil$sysmode --byhyphen \"$lang\""); + $errors += do_cmd_and_check ("$invoke_fmtutil --byhyphen \"$lang\""); } } } @@ -829,7 +834,7 @@ sub handle_execute_actions # if ($::regenerate_all_formats) { info("Regenerating all formats, this may take some time ..."); - $errors += do_cmd_and_check("fmtutil$sysmode --all"); + $errors += do_cmd_and_check("$invoke_fmtutil --all"); info("done\n"); $::regenerate_all_formats = 0; } @@ -4348,7 +4353,8 @@ sub action_generate { debug("$prg: writing language.dat.lua data to $dest\n"); TeXLive::TLUtils::create_language_lua($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { - do_cmd_and_check("fmtutil-sys --byhyphen \"$dest\""); + do_cmd_and_check + ("fmtutil-sys $common_fmtutil_args --byhyphen \"$dest\""); } else { info("To make the newly-generated language.dat.lua take effect," . " run fmtutil-sys --byhyphen $dest.\n"); @@ -4363,7 +4369,8 @@ sub action_generate { debug ("$prg: writing language.dat data to $dest\n"); TeXLive::TLUtils::create_language_dat($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { - do_cmd_and_check("fmtutil-sys --byhyphen \"$dest\""); + do_cmd_and_check + ("fmtutil-sys $common_fmtutil_args --byhyphen \"$dest\""); } else { info("To make the newly-generated language.dat take effect," . " run fmtutil-sys --byhyphen $dest.\n"); @@ -4378,7 +4385,8 @@ sub action_generate { debug("$prg: writing language.def data to $dest\n"); TeXLive::TLUtils::create_language_def($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { - do_cmd_and_check("fmtutil-sys --byhyphen \"$dest\""); + do_cmd_and_check + ("fmtutil-sys $common_fmtutil_args --byhyphen \"$dest\""); } else { info("To make the newly-generated language.def take effect," . " run fmtutil-sys --byhyphen $dest.\n"); @@ -4392,7 +4400,7 @@ sub action_generate { TeXLive::TLUtils::create_fmtutil($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { - do_cmd_and_check("fmtutil-sys --all"); + do_cmd_and_check("fmtutil-sys $common_fmtutil_args --all"); } else { info("To make the newly-generated fmtutil.cnf take effect," . " run fmtutil-sys --all.\n"); @@ -4971,7 +4979,48 @@ sub check_executes { # special case for cont-en ... next if ($name eq "cont-en"); # we check that the name exist in bin/$arch - for my $a ($localtlpdb->available_architectures) { + my @archs_to_check = $localtlpdb->available_architectures; + if ($engine eq "luajittex") { + # luajittex is special since it is not available on all architectures + # due to inherent reasons (machine code) + # We do not want to have error messages here, so we do the following: + # * if tlpkg/tlpsrc/luatex.tlpsrc is available, then load it + # and filter away those archs that are excluded with f/!... + # * if tlpkg/tlpsrc/luatex.tlpsrc is *not* available (user installation) + # we just ignore it completely. + my $tlpsrc_file = $localtlpdb->root . "/tlpkg/tlpsrc/luatex.tlpsrc"; + if (-r $tlpsrc_file) { + require TeXLive::TLPSRC; + my $tlpsrc = new TeXLive::TLPSRC; + $tlpsrc->from_file($tlpsrc_file); + my @binpats = $tlpsrc->binpatterns; + my @negarchs; + for my $p (@binpats) { + if ($p =~ m%^(\w+)/(!?[-_a-z0-9,]+)\s+(.*)$%) { + my $pt = $1; + my $aa = $2; + my $pr = $3; + if ($pr =~ m!/luajittex$!) { + # bingo, get the negative patterns + if ($aa =~ m/^!(.*)$/) { + @negarchs = split(/,/,$1); + } + } + } + } + my %foo; + for my $a (@archs_to_check) { + $foo{$a} = 1; + } + for my $a (@negarchs) { + delete $foo{$a} if defined($foo{$a}); + } + @archs_to_check = keys %foo; + } else { + @archs_to_check = (); + } + } + for my $a (@archs_to_check) { my $f = "$Master/bin/$a/$name"; if (!check_file($a, $f)) { push @{$missingbins{$_}}, "bin/$a/$name" if $mode; diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm index 88c3ad5af04..ac218a2063e 100644 --- a/Master/tlpkg/TeXLive/TLConfig.pm +++ b/Master/tlpkg/TeXLive/TLConfig.pm @@ -48,6 +48,7 @@ BEGIN { %TLPDBSettings %TLPDBConfigs $NetworkTimeout + $PartialEngineSupport ); @EXPORT = @EXPORT_OK; } @@ -191,7 +192,9 @@ our %TLPDBSettings = ( our $WindowsMainMenuName = "TeX Live $ReleaseYear"; -# +# Comma-separated list of engines which do not exist on all platforms. +our $PartialEngineSupport = "luajittex"; + # timeout for network connections (wget, LWP) in seconds our $NetworkTimeout = 30; -- cgit v1.2.3