summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-12-08 23:57:24 +0000
committerKarl Berry <karl@freefriends.org>2015-12-08 23:57:24 +0000
commit0335a3df4d816368f03de1ff0d8c3186ac106fdc (patch)
treeaf857ed8f61467a960919b0e0126404f219b9023
parent764327a56d9427a905c325daf151f344d31b7117 (diff)
* bin/check-fmttriggers: new infrastructure script.
*.tlpsrc: add fmttriggers=, checked/created by check-fmttriggers. git-svn-id: svn://tug.org/texlive/trunk@39057 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/tlpkg/bin/check-fmttriggers377
-rwxr-xr-xMaster/tlpkg/bin/tl-list-format-deps82
-rw-r--r--Master/tlpkg/tlpsrc/aleph.tlpsrc9
-rw-r--r--Master/tlpkg/tlpsrc/amstex.tlpsrc3
-rw-r--r--Master/tlpkg/tlpsrc/context.tlpsrc12
-rw-r--r--Master/tlpkg/tlpsrc/cslatex.tlpsrc11
-rw-r--r--Master/tlpkg/tlpsrc/csplain.tlpsrc21
-rw-r--r--Master/tlpkg/tlpsrc/eplain.tlpsrc3
-rw-r--r--Master/tlpkg/tlpsrc/jadetex.tlpsrc14
-rw-r--r--Master/tlpkg/tlpsrc/latex-bin.tlpsrc36
-rw-r--r--Master/tlpkg/tlpsrc/lollipop.tlpsrc20
-rw-r--r--Master/tlpkg/tlpsrc/luatex.tlpsrc21
-rw-r--r--Master/tlpkg/tlpsrc/metafont.tlpsrc6
-rw-r--r--Master/tlpkg/tlpsrc/mex.tlpsrc14
-rw-r--r--Master/tlpkg/tlpsrc/mltex.tlpsrc12
-rw-r--r--Master/tlpkg/tlpsrc/mptopdf.tlpsrc3
-rw-r--r--Master/tlpkg/tlpsrc/pdftex.tlpsrc21
-rw-r--r--Master/tlpkg/tlpsrc/ptex.tlpsrc16
-rw-r--r--Master/tlpkg/tlpsrc/tex.tlpsrc7
-rw-r--r--Master/tlpkg/tlpsrc/texsis.tlpsrc5
-rw-r--r--Master/tlpkg/tlpsrc/uptex.tlpsrc16
-rw-r--r--Master/tlpkg/tlpsrc/xetex.tlpsrc18
-rw-r--r--Master/tlpkg/tlpsrc/xmltex.tlpsrc12
23 files changed, 570 insertions, 169 deletions
diff --git a/Master/tlpkg/bin/check-fmttriggers b/Master/tlpkg/bin/check-fmttriggers
new file mode 100755
index 00000000000..6241b257468
--- /dev/null
+++ b/Master/tlpkg/bin/check-fmttriggers
@@ -0,0 +1,377 @@
+#!/usr/bin/env perl
+# $Id: check-files-by-format 36922 2015-04-18 22:40:06Z karl $
+# Originally written by Norbert Preining and Karl Berry, 2015. Public domain.
+#
+# Determine the files on which each format (fmt/base) depends
+# (by running fmtutil -recorder),
+# then map those files to TL packages,
+# then check that exactly those packages are listed as triggers in the
+# corresponding tlpsrc files.
+
+my ($tlroot, $Master);
+
+BEGIN {
+ $^W = 1;
+ ($mydir = $0) =~ s,/[^/]*$,,;
+ $tlroot = "$mydir/../..";
+ unshift (@INC, "$tlroot/tlpkg");
+ chomp ($Master = `cd $mydir/../.. && pwd`);
+}
+
+use File::Find;
+use Getopt::Long;
+use Pod::Usage;
+
+use TeXLive::TLConfig;
+use TeXLive::TLUtils qw(info debug ddebug debug_hash tlwarn tldie);
+
+my $prg = TeXLive::TLUtils::basename($0);
+
+my $opt_fmtdir = "/tmp/fmttriggers";
+my $opt_rerecord = 1;
+my $opt_help = 0;
+
+TeXLive::TLUtils::process_logging_options ();
+GetOptions ("fmtdir" => \$opt_fmtdir,
+ "rerecord!" => \$opt_rerecord,
+ "help|?" => \$help) or pod2usage(1);
+pod2usage (-exitstatus => 0, -verbose => 2) if $help;
+
+exit (&main());
+
+
+sub main {
+ if ($opt_rerecord) { # remake recorder files?
+ my $status = &run_fmtutil ($opt_fmtdir);
+ return $status if $status;
+ }
+ #system ("bytime $opt_fmtdir");
+
+ # read recorder files.
+ my %files_per_format = &files_per_format ($opt_fmtdir);
+
+ # read tlpdb.
+ my $tlpdb_file = "$Master/tlpkg/texlive.tlpdb";
+ my ($tlpdb,$fmttriggers) = &tlpdb_by_file ($tlpdb_file);
+
+ # map files used in format building to packages.
+ my %pkgs_per_format = &pkgs_per_format ($tlpdb, %files_per_format);
+
+ # check that those packages are exactly what's listed as needed.
+ return &compare_pkgs_and_triggers (\%pkgs_per_format, $fmttriggers);
+}
+
+
+# Run fmtutil --fmtdir=$OUTDIR --recorder ..., to recreate the recorder
+# files which are the basis for finding the dependencies.
+#
+# OUTDIR is completely removed first (!!), on the theory that this job
+# should only be done in temporary directories.
+#
+sub run_fmtutil {
+ my ($outdir) = @_;
+
+ # yep, destroy output directory tree.
+ TeXLive::TLUtils::rmtree ($outdir);
+ mkdir ($outdir, 0775) || die "$prg: mkdir($outdir) failed: $!";
+
+ # the output from fmtutil can be useful in debugging.
+ my $logfile = "$outdir/fmtutil.log";
+ my $which = "--all";
+ #$which = "--byengine=tex";
+ my $cmd = "fmtutil --sys --recorder --strict --fmtdir=$outdir $which "
+ . ">$logfile 2>&1";
+ &info ("Running $cmd\n");
+ my $retval = system ($cmd);
+ $retval >>= 8 if $retval > 0;
+ if ($retval) {
+ tlwarn ("fmtutil exit status = $retval; contents of $logfile =\n");
+ tlwarn (`cat $logfile`);
+ tldie ("fmtutil failed, goodbye.\n");
+ }
+ return $retval;
+}
+
+
+# Return a hash with each key being a string of the form ENGINE.FORMAT,
+# and the corresponding value a reference to the list of files used to
+# make that format with that engine. This is based on reading the
+# recorder files (format.fls/.ofl) for the format in FMTDIR.
+# Uninteresting files are removed from the list, as is the Master
+# directory prefix.
+#
+sub files_per_format {
+ my ($fmtdir) = @_;
+ my %ret;
+
+ # gather all fls files.
+ my @fls = ();
+ my $recorder_files = sub {
+ # fun with perl: we use an anonymous sub because it's lexically scoped,
+ # hence we can update a my variable inside. Explanation at, e.g.,
+ # http://stackoverflow.com/questions/8839005
+ # In this case, we could also pass a lambda sub to find, since
+ # this sub is so simple, but for purposes of example, do it this way.
+ push (@fls, $File::Find::name)
+ if $File::Find::name =~ /\.(fls|ofl)$/
+ };
+ File::Find::find ($recorder_files, $fmtdir);
+
+ # each fls file will become an entry in the return hash.
+ my $fls_count = @fls;
+ &info ("Reading $fls_count fls file(s): @fls\n");
+ for my $fls_name (@fls) {
+ open (my $fls, $fls_name) || die "open($fls_name) failed: $!";
+ my @files = ();
+ while (<$fls>) {
+ next unless s/^INPUT //;
+ next if m,/web2c/texmf\.cnf$,; # read internally by kpathsea
+ next if m,/fontname/texfonts\.map$,; # likewise
+ next if m,/texsys\.aux$,; # aux file created during run
+ chomp;
+ s,^${Master}/,,; # rm prefix
+ push (@files, $_);
+ }
+ close ($fls) || warn "close($fls_name) failed: $!";
+
+ # The engine name is the directory above the format file,
+ # and the format name is the format file without extension.
+ my ($engine,$format) = ($fls_name =~ m!^.*/([^/]+)/([^/.]+)\.[^/]+$!);
+ #
+ # we'd have to have a similar special case for mpost if mem files
+ # were still used (see rebuild_one_format in fmtutil).
+ $engine = "mf-nowin" if $engine eq "metafont";
+ #
+ my $ef = "$engine.$format";
+
+ # Unfortunately, format filenames themselves are not unique, due to
+ # cont-en and pdfcsplain. Shouldn't be any engine-format dups, though.
+ #
+ tldie ("$prg: already saw format $ef\n (with files @{$ret{$ef}})\n"
+ . " files now = @files\n")
+ if exists $ret{$ef};
+ $ret{$ef} = \@files;
+ }
+
+ #&debug_hash ("files_per_format returning hash", %ret);
+ return %ret;
+}
+
+
+# Read TLPDB_FILE and return references to two hashes: one mapping
+# contained files to TL package names, and a second mapping
+# engine.format names to their specified fmttriggers.
+#
+# Instead of using the general TeXLive::TLPDB functions, read the tlpdb
+# file ourselves. We want to build the file->package mapping just once,
+# for all files, or things become noticeably slow. (The tlpfiles script
+# does this too, but we repeat that code here because we want to find
+# the fmttriggers too.)
+#
+sub tlpdb_by_file {
+ my ($tlpdb_file) = @_;
+ my (%tlpfiles, %fmttriggers);
+
+ open (my $tlpdb, $tlpdb_file) || die "open($tlpdb_file) failed: $!";
+ my $pkg;
+ while (<$tlpdb>) {
+ chomp;
+ if (/^name /) { # notice package names
+ (undef,$pkg) = split (/ /);
+
+ } elsif (s/^execute +AddFormat +//) { # notice AddFormat lines
+ my %af = TeXLive::TLUtils::parse_AddFormat_line ($_);
+ if (exists $af{"error"}) {
+ tldie ("$prg: parse_AddFormat_line failed: $af{error}\n"
+ . "line = $_\n");
+ }
+ if ($af{"fmttriggers"}) {
+ $fmttriggers{"$af{engine}.$af{name}"} = $af{"fmttriggers"};
+ } else {
+ tlwarn ("$prg: no fmttriggers: $_\n");
+ }
+
+ } elsif (s/^ //) { # notice file names
+ # we carefully designed the format so that the only lines with
+ # leading spaces are the files.
+ # The installer "package" isn't one, just ignore it.
+ next if $pkg eq "00texlive.installer";
+ my $f = $_;
+ tldie ("$prg: already saw file $f (package $tlpfiles{$f}), "
+ . "now in package $pkg\n")
+ if exists $tlpfiles{$f}; # should never happen
+ $tlpfiles{$f} = $pkg;
+ }
+ }
+ close ($tlpdb) || warn "close($tlpdb_file) failed: $!";
+
+ &info ("TLPDB files: " . scalar (keys %tlpfiles)
+ . " triggers: " . scalar (keys %fmttriggers) . "\n");
+ return (\%tlpfiles, \%fmttriggers);
+}
+
+
+# Return a hash with each key being a format name and the corresponding
+# value a reference to the list of TL packages which contain the files
+# used to make that format, based on the incoming TLPDB and FILES_PER_FORMAT.
+#
+sub pkgs_per_format {
+ my ($tlpdb,%files_per_format) = @_;
+ my %ret; # format->pkgs mapping
+
+ # we don't include these as fmttriggers since when they meaningfully
+ # change, fmtutil should get called anyway due to language.* changing.
+ my @skip_pkgs = qw(dehyph-exptl hyph-utf8 hyphen-ancientgreek hyphen-german
+ hyphen-greek ruhyphen ukrhyph);
+ # there's also the question of the binaries themselves. we just
+ # ignore that, since it hasn't been a problem in practice: when the
+ # binaries change, everything tends to change anyway.
+
+ for my $format (sort keys %files_per_format) {
+ &debug ("finding packages for $format...\n");
+ my %pkgs_for_this_format;
+ my $files_ref = $files_per_format{$format};
+ for my $f (@$files_ref) {
+ if (exists $tlpdb->{$f}) {
+ my $pkg = $tlpdb->{$f};
+ next if grep ($_ eq $pkg, @skip_pkgs);
+ $pkgs_for_this_format{$pkg} = 1;
+ } else {
+ tlwarn ("$prg: tl package not found for file: $f\n");
+ }
+ }
+ #
+ # looked up all files for this format; save our list of packages.
+ my @pkgs = sort keys %pkgs_for_this_format;
+ &debug (" packages for $format: @pkgs\n");
+ if (@pkgs == 0) {
+ tlwarn ("$prg: no packages for format $format? files = @$files_ref\n");
+ }
+ $ret{$format} = \@pkgs;
+ }
+
+ &info ("Formats found: " . scalar (keys %ret) . "\n");
+ #&debug_hash ("pkgs_per_format returning", %ret);
+ return %ret;
+}
+
+
+# Compare lists of required packages with lists of existing trigger
+# directives. Return 0 if identical, 1 otherwise (and report
+# differences).
+#
+sub compare_pkgs_and_triggers {
+ my ($pkgs_per_format,$fmttriggers) = @_;
+ my $bad_p = 0;
+ my $all_pkgs = 0;
+
+ for my $ef (sort keys %$pkgs_per_format) {
+ my @recorded_pkgs = @{$pkgs_per_format->{$ef}};
+ $all_pkgs += @recorded_pkgs;
+
+ my %recorded_pkgs;
+ @recorded_pkgs{@recorded_pkgs} = (); # hash slice for recorded files
+
+ if (defined $fmttriggers->{$ef}) {
+ my @tlpdb_pkgs = @{$fmttriggers->{$ef}};
+ my %tlpdb_pkgs;
+ @tlpdb_pkgs{@tlpdb_pkgs} = (); # hash slice for the tlpdb side
+
+ my @recorded_only = ();
+ for my $r (keys %recorded_pkgs) {
+ if (exists $tlpdb_pkgs{$r}) {
+ delete $tlpdb_pkgs{$r}; # ok, in both
+ } else {
+ push (@recorded_only, $r);
+ }
+ }
+ if (keys %tlpdb_pkgs) {
+ tlwarn ("$prg: $ef triggers only in tlpdb: "
+ . join (",", keys %tlpdb_pkgs) . "\n");
+ $bad_p = 1;
+ }
+ if (@recorded_only) {
+ tlwarn ("$prg: $ef triggers only in recorder: "
+ . join (",", @recorded_only) . "\n");
+ $bad_p = 1;
+ }
+
+ delete $fmttriggers->{$ef};
+
+ } else {
+ # not in tlpdb at all; output needed fmttriggers directive.
+ tlwarn ("$prg: no fmttriggers in tlpdb: $ef\n"
+ . " fmttriggers=" . join (",", @recorded_pkgs) . "\n");
+ $bad_p = 1;
+ }
+ }
+
+ for my $ef (sort keys %$fmttriggers) {
+ my $trig = join (",", @{$fmttriggers->{$ef}});
+ tlwarn ("$prg: fmttriggers in tlpdb only, not recorder: "
+ . "$ef ($trig)\n");
+ $bad_p = 1;
+ }
+
+ info ("Triggers checked: $all_pkgs (includes duplicates)\n");
+ return $bad_p;
+}
+
+__END__
+
+=head1 NAME
+
+check-fmt-triggers - check that all needed packages trigger format rebuilds
+
+=head1 SYNOPSIS
+
+check-fmt-trigger [I<option>]...
+
+=head1 OPTIONS
+
+=over 4
+
+=item C<--fmtdir> I<dir>
+
+Rebuild formats in I<dir>; default C</tmp/fmttriggers>. This directory
+is completely removed before rebuilding, so do not use any system
+directory.
+
+=item C<--no-rerecord>
+
+Do not rebuild all formats to remake the recorder files; the default
+(C<--rerecord>) is to do so.
+
+=item C<--help>
+
+Print this documentation and exit.
+
+=back
+
+The standard options B<-q>, B<-v>, and B<-logfile>=I<file> are also
+accepted; see the C<process_logging_options> function in
+L<TeXLive::TLUtils> for details.
+
+=head1 DESCRIPTION
+
+This program removes the binary directories of the platforms given as
+arguments; that is, remove the binfiles entries in the tlpdb, and remove
+the containers. (Any xz and wget binaries for the installer remain, though.)
+
+It is used during DVD production to exclude certain platforms, and is
+run from the L<tl-update-images> script.
+
+=head1 AUTHORS AND COPYRIGHT
+
+This script and its documentation were written for the TeX Live
+distribution (L<http://tug.org/texlive>) and both are licensed under the
+GNU General Public License Version 2 or later.
+
+=cut
+
+# Local Variables:
+# perl-indent-level: 2
+# tab-width: 2
+# indent-tabs-mode: nil
+# End:
+# vim: sw=2 expandtab
diff --git a/Master/tlpkg/bin/tl-list-format-deps b/Master/tlpkg/bin/tl-list-format-deps
deleted file mode 100755
index 05d86d3775d..00000000000
--- a/Master/tlpkg/bin/tl-list-format-deps
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-# tl-list-format-deps
-# Create format dependencies
-# (C) 2015 Norbert Preining
-# public domain
-#
-
-# check necessary files before we start
-if ! command -v tlpfiles >/dev/null 2>&1 ; then
- echo "tlpfiles program not found, exiting!" >&2
- exit 1
-fi
-
-texmfvar=`kpsewhich -var-value TEXMFSYSVAR`
-texmfroot=`kpsewhich -var-value TEXMFROOT`
-
-out=format-deps.`date +%Y%m%d%H%M`
-if [ -r $out ] ; then
- echo "output file $out already exists, exiting" >&2
- exit 1
-else
- touch $out
-fi
-
-# rebuild all formats with recorder output
-# needs recent fmtutil!
-read -p "Should we rebuild all formats with recorder option?
-(can only be skipped if uptodate .fls/.ofl files are already available!)
-Y/n: " -t 5 yn
-case $yn in
- [Nn]* ) echo "skipping format rebuild!" ;;
- * ) echo "Rebuilding formats ... please wait a bit!" ;
- fmtutil-sys --recorder --all --quiet
- ;;
-esac
-
-# temp dir for created files
-td=`mktemp -d`
-
-# first strip all irrelevant info from the .fls
-for i in $texmfvar/web2c/*/*.fls $texmfvar/web2c/*/*.ofl ; do
- fmt=$(basename $i .fls)
- fmt=$(basename $fmt .ofl)
- grep -v ^PWD $i | \
- grep -v ^OUTPUT | \
- awk '{print$2}' | \
- sed -e "s!$texmfroot/!!" | \
- grep -v '^\./texsys.aux' | \
- grep -v '^texmf.cnf' | \
- grep -v '^texmf-config' | \
- grep -v '^texmf-var' | \
- grep -v '^texmf/' | \
- cat > $td/$fmt.input
-done
-
-# next collect all files used of all, and uniq them
-usedfls=`cat $td/*.input | sort | uniq`
-tlpfiles -fullpath -pkgof "$usedfls" > $td/file-to-pkg
-
-for i in $td/*.input ; do
- fmt=$(basename $i .input)
- for f in `cat $i` ; do
- fnd=`grep -P "\t$f" $td/file-to-pkg`
- if [ -n "$fnd" ] ; then
- pkg=$(echo $fnd | awk '{print$1}')
- echo $pkg >> $td/$fmt.packages.tmp
- echo "$pkg:$f" >> $td/$fmt.input.with-pkgs
- else
- echo "cannot find $f for $fmt!" >&2
- fi
- done
- sort $td/$fmt.packages.tmp | uniq > $td/$fmt.packages
- echo $fmt >> $out
- echo "------------" >> $out
- cat $td/$fmt.packages >> $out
- echo >> $out
- rm $td/$fmt.packages.tmp
-done
-
-echo "Output stored in $out"
-echo "Temporary files in $td, please remove if not needed."
-
diff --git a/Master/tlpkg/tlpsrc/aleph.tlpsrc b/Master/tlpkg/tlpsrc/aleph.tlpsrc
index ea6c137ef3f..18cfb81920e 100644
--- a/Master/tlpkg/tlpsrc/aleph.tlpsrc
+++ b/Master/tlpkg/tlpsrc/aleph.tlpsrc
@@ -1,10 +1,15 @@
depend latex
depend plain
depend lambda
+
+tlpsetvar fmtcomm cm,hyphen-base
#
-execute AddFormat name=aleph engine=aleph options=*aleph.ini
+execute AddFormat name=aleph engine=aleph options=*aleph.ini \
+ fmttriggers=${fmtcomm},knuth-lib,plain
execute AddFormat name=lamed engine=aleph patterns=language.dat \
- options=*lambda.ini
+ options=*lambda.ini \
+ fmttriggers=${fmtcomm},antomega,lambda,latex,latex-fonts,omega
+
binpattern f bin/${ARCH}/aleph
binpattern f bin/${ARCH}/lamed
docpattern +f texmf-dist/doc/man/man1/aleph.*
diff --git a/Master/tlpkg/tlpsrc/amstex.tlpsrc b/Master/tlpkg/tlpsrc/amstex.tlpsrc
index be90344d3a7..133a174b8df 100644
--- a/Master/tlpkg/tlpsrc/amstex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/amstex.tlpsrc
@@ -1,6 +1,7 @@
depend tex
execute AddFormat name=amstex engine=pdftex \
- options="-translate-file=cp227.tcx *amstex.ini"
+ options="-translate-file=cp227.tcx *amstex.ini" \
+ fmttriggers=amsfonts,amstex,cm,hyphen-base,knuth-lib,plain
#
docpattern +f texmf-dist/doc/man/man1/amstex.*
#
diff --git a/Master/tlpkg/tlpsrc/context.tlpsrc b/Master/tlpkg/tlpsrc/context.tlpsrc
index 504c3f97fd0..d8944ba94bf 100644
--- a/Master/tlpkg/tlpsrc/context.tlpsrc
+++ b/Master/tlpkg/tlpsrc/context.tlpsrc
@@ -17,19 +17,19 @@ depend mflogo-font
depend stmaryrd
#
execute AddFormat name=cont-en engine=pdftex \
- patterns=cont-usr.tex options="-8bit *cont-en.mkii"
+ patterns=cont-usr.tex options="-8bit *cont-en.mkii" fmttriggers=context
execute AddFormat name=cont-en engine=xetex \
- patterns=cont-usr.tex options="-8bit *cont-en.mkii"
+ patterns=cont-usr.tex options="-8bit *cont-en.mkii" fmttriggers=context
#
# disabled context formats:
execute AddFormat name=cont-fr mode=disabled engine=pdftex \
- patterns=cont-usr.tex options="-8bit *cont-fr.mkii"
+ patterns=cont-usr.tex options="-8bit *cont-fr.mkii" fmttriggers=context
execute AddFormat name=cont-it mode=disabled engine=pdftex \
- patterns=cont-usr.tex options="-8bit *cont-it.mkii"
+ patterns=cont-usr.tex options="-8bit *cont-it.mkii" fmttriggers=context
execute AddFormat name=cont-nl mode=disabled engine=pdftex \
- patterns=cont-usr.tex options="-8bit *cont-nl.mkii"
+ patterns=cont-usr.tex options="-8bit *cont-nl.mkii" fmttriggers=context
execute AddFormat name=cont-ro mode=disabled engine=pdftex \
- patterns=cont-usr.tex options="-8bit *cont-ro.mkii"
+ patterns=cont-usr.tex options="-8bit *cont-ro.mkii" fmttriggers=context
#
# contnav, hans, hans-sh fonts.
execute addMap original-context-symbol.map
diff --git a/Master/tlpkg/tlpsrc/cslatex.tlpsrc b/Master/tlpkg/tlpsrc/cslatex.tlpsrc
index 1630221b21d..931ed76cbb1 100644
--- a/Master/tlpkg/tlpsrc/cslatex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/cslatex.tlpsrc
@@ -1,9 +1,14 @@
depend latex
+
+tlpsetvar fmtcomm cm,cslatex,csplain,hyphen-base,latex-fonts,latex
#
execute AddFormat name=cslatex engine=pdftex \
- options="-etex cslatex.ini"
-execute AddFormat name=pdfcslatex engine=pdftex \
- options="-etex cslatex.ini"
+ options="-etex cslatex.ini" \
+ fmttriggers=${fmtcomm}
#
+execute AddFormat name=pdfcslatex engine=pdftex \
+ options="-etex cslatex.ini" \
+ fmttriggers=${fmtcomm},pdftex
+
binpattern f bin/${ARCH}/cslatex
binpattern f bin/${ARCH}/pdfcslatex
diff --git a/Master/tlpkg/tlpsrc/csplain.tlpsrc b/Master/tlpkg/tlpsrc/csplain.tlpsrc
index 43e11b65815..3782a131d41 100644
--- a/Master/tlpkg/tlpsrc/csplain.tlpsrc
+++ b/Master/tlpkg/tlpsrc/csplain.tlpsrc
@@ -1,17 +1,26 @@
depend tex
+
+# these invocations per author (Petr Olsak.)
+#
+tlpsetvar fmtcomm cm,cs,csplain,hyphen-base,plain
#
-# these invocations from Petr Olsak.
execute AddFormat name=csplain engine=pdftex \
- options="-etex -enc csplain-utf8.ini"
+ options="-etex -enc csplain-utf8.ini" \
+ fmttriggers=${fmtcomm},enctex
+#
execute AddFormat name=pdfcsplain engine=pdftex \
- options="-etex -enc csplain-utf8.ini"
+ options="-etex -enc csplain-utf8.ini" \
+ fmttriggers=${fmtcomm},enctex,pdftex
#
# intentionally no user-level executables for these formats, also named
-# pdfcsplain (a la ConTeXt).
+# pdfcsplain (a la ConTeXt), by author's request.
execute AddFormat name=pdfcsplain engine=xetex \
- options="-etex csplain.ini"
+ options="-etex csplain.ini" \
+ fmttriggers=${fmtcomm}
+#
execute AddFormat name=pdfcsplain engine=luatex \
- options="-etex csplain.ini"
+ options="-etex csplain.ini" \
+ fmttriggers=${fmtcomm},luatex,pdftex
#
binpattern f bin/${ARCH}/csplain
binpattern f bin/${ARCH}/pdfcsplain
diff --git a/Master/tlpkg/tlpsrc/eplain.tlpsrc b/Master/tlpkg/tlpsrc/eplain.tlpsrc
index a612de62e19..c7f241e487a 100644
--- a/Master/tlpkg/tlpsrc/eplain.tlpsrc
+++ b/Master/tlpkg/tlpsrc/eplain.tlpsrc
@@ -1,6 +1,7 @@
depend pdftex
execute AddFormat name=eplain engine=pdftex patterns=language.dat \
- options="-translate-file=cp227.tcx *eplain.ini"
+ options="-translate-file=cp227.tcx *eplain.ini" \
+ fmttriggers=babel,cm,eplain,hyphen-base,knuth-lib,latex-fonts,plain
docpattern +f texmf-dist/doc/info/eplain.info
docpattern +f texmf-dist/doc/man/man1/eplain.*
binpattern f bin/${ARCH}/eplain
diff --git a/Master/tlpkg/tlpsrc/jadetex.tlpsrc b/Master/tlpkg/tlpsrc/jadetex.tlpsrc
index 58e1e609bea..a03a087b729 100644
--- a/Master/tlpkg/tlpsrc/jadetex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/jadetex.tlpsrc
@@ -2,12 +2,20 @@ depend latex
depend passivetex
depend pdftex
depend tex
+
+tlpsetvar fmtcomm amsfonts,babel,cm,colortbl,cyrillic,ec,fancyhdr,graphics,\
+hyperref,hyphen-base,ifxetex,jadetex,latex,latex-fonts,\
+latexconfig,marvosym,oberdiek,passivetex,pdftex,psnfss,stmaryrd,\
+symbol,tipa,tools,ulem,url,wasysym,zapfding
#
execute AddFormat name=jadetex engine=pdftex patterns=language.dat \
- options="*jadetex.ini"
-execute AddFormat name=pdfjadetex engine=pdftex patterns=language.dat \
- options="*pdfjadetex.ini"
+ options="*jadetex.ini" \
+ fmttriggers=${fmtcomm}
#
+execute AddFormat name=pdfjadetex engine=pdftex patterns=language.dat \
+ options="*pdfjadetex.ini" \
+ fmttriggers=${fmtcomm},pdftex-def
+
binpattern f bin/${ARCH}/jadetex
binpattern f bin/${ARCH}/pdfjadetex
#
diff --git a/Master/tlpkg/tlpsrc/latex-bin.tlpsrc b/Master/tlpkg/tlpsrc/latex-bin.tlpsrc
index c1efd6824ea..4232823c762 100644
--- a/Master/tlpkg/tlpsrc/latex-bin.tlpsrc
+++ b/Master/tlpkg/tlpsrc/latex-bin.tlpsrc
@@ -4,31 +4,41 @@ shortdesc LaTeX executables and man pages.
# we must depend on latex, not the other way around, to ensure that all
# files are installed before we try to make the formats.
depend latex
+
+tlpsetvar fmtcomm babel,cm,hyphen-base,latex,latexconfig,latex-fonts,pdftex
#
binpattern f bin/${ARCH}/latex
-execute AddFormat name=latex engine=pdftex patterns=language.dat \
- options="-translate-file=cp227.tcx *latex.ini"
+execute AddFormat name=latex engine=pdftex \
+ patterns=language.dat \
+ options="-translate-file=cp227.tcx *latex.ini" \
+ fmttriggers=${fmtcomm}
#
binpattern f bin/${ARCH}/pdflatex
-execute AddFormat name=pdflatex engine=pdftex patterns=language.dat \
- options="-translate-file=cp227.tcx *pdflatex.ini"
+execute AddFormat name=pdflatex engine=pdftex \
+ patterns=language.dat \
+ options="-translate-file=cp227.tcx *pdflatex.ini" \
+ fmttriggers=${fmtcomm}
#
binpattern f bin/${ARCH}/dvilualatex
execute AddFormat name=dvilualatex engine=luatex \
- patterns=language.dat,language.dat.lua \
- options="dvilualatex.ini"
+ patterns=language.dat,language.dat.lua \
+ options="dvilualatex.ini" \
+ fmttriggers=${fmtcomm}
#
binpattern f bin/${ARCH}/lualatex
execute AddFormat name=lualatex engine=luatex \
- patterns=language.dat,language.dat.lua \
- options="lualatex.ini"
-#
-docpattern f texmf-dist/doc/man/man1/latex.*
-docpattern f texmf-dist/doc/man/man1/pdflatex.*
+ patterns=language.dat,language.dat.lua \
+ options="lualatex.ini" \
+ fmttriggers=${fmtcomm}
#
# disabled-by-default luajitlatex format for experimentation
# (just PDF until someone wants DVI?):
#binpattern f bin/${ARCH}/luajitlatex
execute AddFormat name=luajitlatex mode=disabled engine=luajittex \
- patterns=language.dat,language.dat.lua \
- options="lualatex.ini"
+ patterns=language.dat,language.dat.lua \
+ options="lualatex.ini" \
+ fmttriggers=${fmtcomm},cslatex
+
+
+docpattern f texmf-dist/doc/man/man1/latex.*
+docpattern f texmf-dist/doc/man/man1/pdflatex.*
diff --git a/Master/tlpkg/tlpsrc/lollipop.tlpsrc b/Master/tlpkg/tlpsrc/lollipop.tlpsrc
index 37d93b3ce3b..d846543faf2 100644
--- a/Master/tlpkg/tlpsrc/lollipop.tlpsrc
+++ b/Master/tlpkg/tlpsrc/lollipop.tlpsrc
@@ -1,17 +1,25 @@
+tlpsetvar fmtcomm cm,hyphen-base,lollipop
+
binpattern f bin/${ARCH}/lollipop
execute AddFormat name=lollipop engine=pdftex \
- options="-translate-file=cp227.tcx *lollipop.ini"
+ options="-translate-file=cp227.tcx *lollipop.ini" \
+ fmttriggers=${fmtcomm},pdftex
#
binpattern f bin/${ARCH}/lualollipop
execute AddFormat name=lualollipop engine=luatex \
- options="lualollipop.ini"
+ options="lualollipop.ini" \
+ fmttriggers=${fmtcomm},pdftex,luatex
#
binpattern f bin/${ARCH}/xelollipop
execute AddFormat name=xelollipop engine=xetex \
- options="-etex xelollipop.ini"
+ options="-etex xelollipop.ini" \
+ fmttriggers=${fmtcomm},xetexconfig
#
-# leave dvi formats disabled, users can set \pdfoutput=0.
+# dvi formats disabled by default, users can set \pdfoutput=0.
execute AddFormat name=dvilollipop mode=disabled engine=pdftex \
- options="-translate-file=cp227.tcx *lollipop.ini"
+ options="-translate-file=cp227.tcx *lollipop.ini" \
+ fmttriggers=${fmtcomm},pdftex
+#
execute AddFormat name=dvilualollipop mode=disabled engine=luatex \
- options="-translate-file=cp227.tcx lualollipop.ini"
+ options="-translate-file=cp227.tcx lualollipop.ini" \
+ fmttriggers=${fmtcomm},luatex,pdftex
diff --git a/Master/tlpkg/tlpsrc/luatex.tlpsrc b/Master/tlpkg/tlpsrc/luatex.tlpsrc
index e216a9c651f..ebac3b968bd 100644
--- a/Master/tlpkg/tlpsrc/luatex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/luatex.tlpsrc
@@ -1,17 +1,20 @@
category TLCore
#
-execute AddFormat \
- name=luatex engine=luatex patterns=language.def,language.dat.lua \
- options="luatex.ini"
-execute AddFormat \
- name=dviluatex engine=luatex patterns=language.def,language.dat.lua \
- options="dviluatex.ini"
+tlpsetvar fmtdeps cm,etex,hyphen-base,knuth-lib,luatex,plain
+#
+execute AddFormat name=luatex engine=luatex options="luatex.ini" \
+ patterns=language.def,language.dat.lua \
+ fmttriggers=${fmtdeps},pdftex
+#
+execute AddFormat name=dviluatex engine=luatex options="dviluatex.ini" \
+ patterns=language.def,language.dat.lua \
+ fmttriggers=${fmtdeps}
#
# On platforms where there is no luajittex, it will be ignored
# due to special options in fmtutil and TLConfig.pm.
-execute AddFormat \
- name=luajittex engine=luajittex patterns=language.def,language.dat.lua \
- options="luatex.ini"
+execute AddFormat name=luajittex engine=luajittex options="luatex.ini" \
+ patterns=language.def,language.dat.lua \
+ fmttriggers=${fmtdeps},pdftex
#
docpattern d texmf-dist/doc/luatex/base
docpattern f texmf-dist/doc/man/man1/luatex.*
diff --git a/Master/tlpkg/tlpsrc/metafont.tlpsrc b/Master/tlpkg/tlpsrc/metafont.tlpsrc
index 019dfbc4dda..ab31b97b483 100644
--- a/Master/tlpkg/tlpsrc/metafont.tlpsrc
+++ b/Master/tlpkg/tlpsrc/metafont.tlpsrc
@@ -1,7 +1,9 @@
depend kpathsea
+
execute AddFormat name=mf engine=mf-nowin \
- options="-translate-file=cp227.tcx mf.ini"
-#
+ options="-translate-file=cp227.tcx mf.ini" \
+ fmttriggers=metafont
+
srcpattern f ignore
#
runpattern d texmf-dist/metafont/base
diff --git a/Master/tlpkg/tlpsrc/mex.tlpsrc b/Master/tlpkg/tlpsrc/mex.tlpsrc
index a6de17090fb..dc9d5c0b9e1 100644
--- a/Master/tlpkg/tlpsrc/mex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/mex.tlpsrc
@@ -2,12 +2,20 @@ depend pl
depend hyphen-polish
depend pdftex
depend tex
+
+tlpsetvar fmtcomm hyphen-base,knuth-lib,mex,pdftex,pl,plain
+#
execute AddFormat name=mex engine=pdftex patterns=mexconf.tex \
- options="-translate-file=cp227.tcx *mex.ini"
+ options="-translate-file=cp227.tcx *mex.ini" \
+ fmttriggers=${fmtcomm}
+#
execute AddFormat name=pdfmex engine=pdftex patterns=mexconf.tex \
- options="-translate-file=cp227.tcx *pdfmex.ini"
+ options="-translate-file=cp227.tcx *pdfmex.ini" \
+ fmttriggers=${fmtcomm}
+#
execute AddFormat name=utf8mex engine=pdftex patterns=mexconf.tex \
- options="-enc *utf8mex.ini"
+ options="-enc *utf8mex.ini" \
+ fmttriggers=${fmtcomm},enctex,utf8mex
#
runpattern +!d texmf-dist/tex/mex/utf8mex
#
diff --git a/Master/tlpkg/tlpsrc/mltex.tlpsrc b/Master/tlpkg/tlpsrc/mltex.tlpsrc
index fa132abcf46..d6b01bbf53e 100644
--- a/Master/tlpkg/tlpsrc/mltex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/mltex.tlpsrc
@@ -1,8 +1,14 @@
depend latex
+
+tlpsetvar fmtdeps cm,hyphen-base
+#
execute AddFormat name=mllatex engine=pdftex patterns=language.dat \
- options="-translate-file=cp227.tcx -mltex *mllatex.ini"
-execute AddFormat name=mltex engine=pdftex \
- options="-translate-file=cp227.tcx -mltex mltex.ini"
+ options="-translate-file=cp227.tcx -mltex *mllatex.ini" \
+ fmttriggers=${fmtdeps},babel,latex,latexconfig,latex-fonts
#
+execute AddFormat name=mltex engine=pdftex \
+ options="-translate-file=cp227.tcx -mltex mltex.ini" \
+ fmttriggers=${fmtdeps},knuth-lib,mltex,plain
+
binpattern f bin/${ARCH}/mllatex
binpattern f bin/${ARCH}/mltex
diff --git a/Master/tlpkg/tlpsrc/mptopdf.tlpsrc b/Master/tlpkg/tlpsrc/mptopdf.tlpsrc
index 0a2adca27e8..adbe8d9df08 100644
--- a/Master/tlpkg/tlpsrc/mptopdf.tlpsrc
+++ b/Master/tlpkg/tlpsrc/mptopdf.tlpsrc
@@ -11,7 +11,8 @@ longdesc
longdesc This can be found on CTAN in macros/pdftex/graphics.
execute AddFormat name=mptopdf engine=pdftex \
- options="-translate-file=cp227.tcx mptopdf.tex"
+ options="-translate-file=cp227.tcx mptopdf.tex" \
+ fmttriggers=mptopdf,plain
runpattern f texmf-dist/tex/context/base/supp-mis.mkii
runpattern f texmf-dist/tex/context/base/supp-mpe.mkii
diff --git a/Master/tlpkg/tlpsrc/pdftex.tlpsrc b/Master/tlpkg/tlpsrc/pdftex.tlpsrc
index 1beb760d823..6ee4d958f3b 100644
--- a/Master/tlpkg/tlpsrc/pdftex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/pdftex.tlpsrc
@@ -1,16 +1,23 @@
category TLCore
depend kpathsea
+
+tlpsetvar fmtcomm cm,etex,hyphen-base,knuth-lib,plain
#
-execute AddFormat name=pdftex engine=pdftex patterns=language.def \
- options="-translate-file=cp227.tcx *pdfetex.ini"
-execute AddFormat name=etex engine=pdftex patterns=language.def \
- options="-translate-file=cp227.tcx *etex.ini"
-execute AddFormat name=pdfetex engine=pdftex patterns=language.def \
- options="-translate-file=cp227.tcx *pdfetex.ini"
+execute AddFormat name=pdftex engine=pdftex patterns=language.def \
+ options="-translate-file=cp227.tcx *pdfetex.ini" \
+ fmttriggers=${fmtcomm},pdftex
+#
+execute AddFormat name=etex engine=pdftex patterns=language.def \
+ options="-translate-file=cp227.tcx *etex.ini" \
+ fmttriggers=${fmtcomm}
#
+execute AddFormat name=pdfetex engine=pdftex patterns=language.def \
+ options="-translate-file=cp227.tcx *pdfetex.ini" \
+ fmttriggers=${fmtcomm},pdftex
+
# A trivial font needed by the fake-interword-space feature.
execute addMap dummy-space.map
-#
+
runpattern f texmf-dist/tex/generic/config/pdftex*.tex
runpattern d texmf-dist/tex/generic/pdftex
runpattern d texmf-dist/fonts/map/pdftex/updmap
diff --git a/Master/tlpkg/tlpsrc/ptex.tlpsrc b/Master/tlpkg/tlpsrc/ptex.tlpsrc
index f6c0c037d82..07e93180a17 100644
--- a/Master/tlpkg/tlpsrc/ptex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/ptex.tlpsrc
@@ -5,12 +5,20 @@ depend adobemapping
depend ipaex
depend japanese
depend japanese-otf
+
+tlpsetvar fmtcomm cm,hyphen-base,ptex
+#
+execute AddFormat name=ptex engine=ptex options="ptex.ini" \
+ fmttriggers=${fmtcomm},knuth-lib,plain
+#
+execute AddFormat name=eptex engine=eptex options="*eptex.ini" \
+ patterns=language.def \
+ fmttriggers=${fmtcomm},etex,knuth-lib,plain
#
-execute AddFormat name=ptex engine=ptex options="ptex.ini"
-execute AddFormat name=eptex engine=eptex options="*eptex.ini" \
- patterns=language.def
execute AddFormat name=platex engine=eptex options="*platex.ini" \
- patterns=language.dat
+ patterns=language.dat \
+ fmttriggers=${fmtcomm},babel,latex,latex-fonts
+
execute addKanjiMap ptex-@kanjiEmbed@@kanjiVariant@.map
execute addKanjiMap morisawa.map
#
diff --git a/Master/tlpkg/tlpsrc/tex.tlpsrc b/Master/tlpkg/tlpsrc/tex.tlpsrc
index 9dd4e6d1c27..1bfa474fef7 100644
--- a/Master/tlpkg/tlpsrc/tex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/tex.tlpsrc
@@ -1,9 +1,10 @@
category TLCore
-execute AddFormat name=tex engine=tex options="tex.ini"
-#
depend kpathsea
depend plain
-#
+
+execute AddFormat name=tex engine=tex options="tex.ini" \
+ fmttriggers=cm,hyphen-base,knuth-lib,plain
+
docpattern f texmf-dist/doc/man/man1/tex.*
#
binpattern f bin/${ARCH}/initex
diff --git a/Master/tlpkg/tlpsrc/texsis.tlpsrc b/Master/tlpkg/tlpsrc/texsis.tlpsrc
index 56b8f514a93..9bcf2d281d2 100644
--- a/Master/tlpkg/tlpsrc/texsis.tlpsrc
+++ b/Master/tlpkg/tlpsrc/texsis.tlpsrc
@@ -1,4 +1,7 @@
depend tex
+
execute AddFormat name=texsis engine=pdftex \
- options="-translate-file=cp227.tcx texsis.ini"
+ options="-translate-file=cp227.tcx texsis.ini" \
+ fmttriggers=cm,hyphen-base,knuth-lib,plain,texsis
+
binpattern f bin/${ARCH}/texsis
diff --git a/Master/tlpkg/tlpsrc/uptex.tlpsrc b/Master/tlpkg/tlpsrc/uptex.tlpsrc
index 4e8434dfd28..f486c334d15 100644
--- a/Master/tlpkg/tlpsrc/uptex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/uptex.tlpsrc
@@ -7,11 +7,19 @@ depend japanese
depend japanese-otf
depend latex
#
-execute AddFormat name=uptex engine=uptex options="uptex.ini"
-execute AddFormat name=euptex engine=euptex options="*euptex.ini" \
- patterns=language.def
+tlpsetvar fmtcomm cm,hyphen-base,uptex
+#
+execute AddFormat name=uptex engine=uptex options="uptex.ini" \
+ fmttriggers=${fmtcomm},knuth-lib,plain,uptex
+#
+execute AddFormat name=euptex engine=euptex options="*euptex.ini" \
+ patterns=language.def \
+ fmttriggers=${fmtcomm},etex,knuth-lib,plain,ptex
+#
execute AddFormat name=uplatex engine=euptex options="*uplatex.ini" \
- patterns=language.dat
+ patterns=language.dat \
+ fmttriggers=${fmtcomm},babel,latex,latex-fonts,ptex
+#
execute addKanjiMap uptex-@kanjiEmbed@@kanjiVariant@.map
#
binpattern f bin/${ARCH}/euptex
diff --git a/Master/tlpkg/tlpsrc/xetex.tlpsrc b/Master/tlpkg/tlpsrc/xetex.tlpsrc
index 2c062ef7f89..ac472af5008 100644
--- a/Master/tlpkg/tlpsrc/xetex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/xetex.tlpsrc
@@ -1,20 +1,26 @@
category TLCore
shortdesc Unicode and OpenType-enabled TeX engine.
longdesc See http://tug.org/xetex.
+
+tlpsetvar fmtcomm cm,hyphen-base
#
execute AddFormat name=xetex engine=xetex patterns=language.def \
- options="-etex xetex.ini"
-execute AddFormat name=xelatex engine=xetex patterns=language.dat \
- options="-etex xelatex.ini"
+ options="-etex xetex.ini" \
+ fmttriggers=${fmtcomm},etex,plain
#
+execute AddFormat name=xelatex engine=xetex patterns=language.dat \
+ options="-etex xelatex.ini" \
+ fmttriggers=${fmtcomm},babel,latex,latexconfig,latex-fonts
+
+# do fontconfig stuff, especially on Windows.
postaction script file=tlpkg/tlpostcode/xetex.pl
runpattern f tlpkg/tlpostcode/xetex.pl
binpattern f bin/win32/fc-*
binpattern f bin/win32/icu*.dll
#
-# this is only used in windows installation
+# this subdir is only used on Windows.
binpattern d/win32 tlpkg/tlpostcode/xetex
-#
+
docpattern d texmf-dist/doc/xetex/base
#
runpattern d texmf-dist/fonts/misc/xetex/fontmapping/base
@@ -24,6 +30,6 @@ binpattern f bin/${ARCH}/xdvipdfmx
binpattern f bin/${ARCH}/xelatex
binpattern f bin/${ARCH}/xetex
binpattern f bin/${ARCH}/teckit_compile
-#
+
depend xetexconfig
depend latex
diff --git a/Master/tlpkg/tlpsrc/xmltex.tlpsrc b/Master/tlpkg/tlpsrc/xmltex.tlpsrc
index 1e6c6f37f8f..0d1b21c58eb 100644
--- a/Master/tlpkg/tlpsrc/xmltex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/xmltex.tlpsrc
@@ -2,12 +2,18 @@ depend latex
depend pdftex
depend tex
depend xmltexconfig
+
+tlpsetvar fmtcomm babel,cm,hyphen-base,latex,latex-fonts,latexconfig,pdftex,\
+xmltex,xmltexconfig
#
execute AddFormat name=xmltex engine=pdftex patterns=language.dat \
- options="*xmltex.ini"
-execute AddFormat name=pdfxmltex engine=pdftex patterns=language.dat \
- options="*pdfxmltex.ini"
+ options="*xmltex.ini" \
+ fmttriggers=${fmtcomm}
#
+execute AddFormat name=pdfxmltex engine=pdftex patterns=language.dat \
+ options="*pdfxmltex.ini" \
+ fmttriggers=${fmtcomm}
+
runpattern d texmf-dist/tex/xmltex/base
#
binpattern f bin/${ARCH}/pdfxmltex