summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-04-21 00:17:48 +0000
committerKarl Berry <karl@freefriends.org>2014-04-21 00:17:48 +0000
commit1df297d584d71161b479472d60d102e11fd9b2c7 (patch)
treee1545ef95b66a0a1856579fde19b3ca1069ccd9c /Master/texmf-dist/scripts
parentfae622b32d248acd0eefefeb6990fef5e5da816c (diff)
allow for luajittex not available on all platforms
git-svn-id: svn://tug.org/texlive/trunk@33571 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.sh21
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl71
2 files changed, 80 insertions, 12 deletions
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;