summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-05-20 17:08:42 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-05-20 17:08:42 +0000
commitcce69ad0b59b059976669eb922832fd161493af8 (patch)
tree7ea283771d719501e6af00fe5df7643769331d68 /Master/texmf
parent3df5aab7ab8f7c7d8b9c11ddfb4278a4f6948f7c (diff)
Implement generation of language.dat.lua by extending execute AddHyphen.
git-svn-id: svn://tug.org/texlive/trunk@18379 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl70
-rw-r--r--Master/texmf/tex/generic/config/language.us.lua25
2 files changed, 69 insertions, 26 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index bf26049cd96..f63b531361a 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -669,23 +669,27 @@ sub handle_execute_actions
}
if ($do_something) {
- for my $ext ("dat", "def") {
+ for my $ext ("dat", "def", "dat.lua") {
my $lang = "language.$ext";
info("regenerating $lang\n");
my $arg1 = "$TEXMFSYSVAR/tex/generic/config/language.$ext";
- my $arg2 = "$TEXMFLOCAL/tex/generic/config/language-local.dat";
+ my $arg2 = "$TEXMFLOCAL/tex/generic/config/language-local.$ext";
if ($ext eq "dat") {
TeXLive::TLUtils::create_language_dat($localtlpdb, $arg1, $arg2);
- } else {
+ } elsif ($ext eq "def") {
TeXLive::TLUtils::create_language_def($localtlpdb, $arg1, $arg2);
+ } else {
+ TeXLive::TLUtils::create_language_lua($localtlpdb, $arg1, $arg2);
}
if (! TeXLive::TLUtils::win32()) {
# Use full path for external command, except on Windows.
$lang = "$TEXMFSYSVAR/tex/generic/config/$lang";
}
- if ($localtlpdb->option("create_formats") && !$::regenerate_all_formats) {
+ if ($localtlpdb->option("create_formats")
+ && !$::regenerate_all_formats
+ && $ext ne "dat.lua") {
$errors += do_cmd_and_check("fmtutil-sys --byhyphen $lang");
}
}
@@ -3200,7 +3204,7 @@ sub action_generate {
chomp (my $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`);
chomp (my $TEXMFLOCAL = `kpsewhich -var-value=TEXMFLOCAL`);
- if ($what =~ m/^language(\.dat|\.def)?$/i) {
+ if ($what =~ m/^language(\.dat|\.def|\.dat\.lua)?$/i) {
#
# if --rebuild-sys is given *and* --dest we warn that this might not
# work if the destination is not the default one
@@ -3240,6 +3244,14 @@ sub action_generate {
. " run fmtutil-sys --byhyphen $dest.\n");
}
}
+ if ($what =~ m/^language(\.dat\.lua)?$/i) {
+ my $dest = $opts{"dest"} ? $opts{"dest"} . '.dat.lua' :
+ "$TEXMFSYSVAR/tex/generic/config/language.dat.lua";
+ my $localcfg = $opts{"localcfg"} ||
+ "$TEXMFLOCAL/tex/generic/config/language-local.dat.lua";
+ debug("$0: writing language.dat.lua data to $dest\n");
+ TeXLive::TLUtils::create_language_lua($localtlpdb, $dest, $localcfg);
+ }
} elsif ($what =~ m/^fmtutil$/i) {
my $dest = $opts{"dest"} || "$TEXMFSYSVAR/web2c/fmtutil.cnf";
@@ -5365,6 +5377,8 @@ Do not ask for confirmation, remove immediately.
=item B<generate language.def>
+=item B<generate language.dat.lua>
+
=item B<generate fmtutil>
=item B<generate updmap>
@@ -5392,31 +5406,33 @@ C<updmap-local.cfg>, there is nothing wrong with using C<generate
updmap>. Indeed, we use it ourselves to generate the C<updmap.cfg> file
in the live source repository.
-In more detail: C<generate> remakes any of the four config files
-C<language.dat>, C<language.def>, C<fmtutil.cnf>, and C<updmap.cfg> from
-the information present in the local TLPDB, plus locally-maintained
-files.
+In more detail: C<generate> remakes any of the five config files
+C<language.dat>, C<language.def>, C<language.dat.lua>, C<fmtutil.cnf>,
+and C<updmap.cfg> from the information present in the local TLPDB, plus
+locally-maintained files.
The locally-maintained files are C<language-local.dat>,
-C<language-local.def>, C<fmtutil-local.cnf>, or C<updmap-local.cfg>,
-searched for in C<TEXMFLOCAL> in the respective directories. If they
-are present, the final file is made by starting with the main file,
-omitting any entries that the local file specifies to be disabled, and
-finally appending the local file.
+C<language-local.def>, C<language-local.dat.lua>, C<fmtutil-local.cnf>,
+or C<updmap-local.cfg>, searched for in C<TEXMFLOCAL> in the respective
+directories. If they are present, the final file is made by starting
+with the main file, omitting any entries that the local file specifies
+to be disabled, and finally appending the local file.
Local files specify entries to be disabled with a comment line like this:
#!NAME
%!NAME
+ --!NAME
-where C<fmtutil.cnf> and C<updmap.cfg> use C<#>, and C<language.dat> and
-C<language.def> use C<%>. In any case, the I<name> is the respective
-format name, map file name (include the C<.map> extension), or
-hyphenation pattern identifier. Examples:
+where C<fmtutil.cnf> and C<updmap.cfg> use C<#>, C<language.dat> and
+C<language.def> use C<%>, and C<language.dat.lua> use C<-->. In any
+case, the I<name> is the respective format name, map file name (include
+the C<.map> extension), or hyphenation pattern identifier. Examples:
#!pdflatex
#!lm.map
%!german
+ --!usenglishmax
(Of course, you're not likely to actually want to disable those
particular items. They're just examples.)
@@ -5426,9 +5442,9 @@ for the same item, if a different definition is desired. In general,
except for the special disabling lines, the local files follow the same
syntax as the master files.
-The form C<generate language> recreates both the C<language.dat> and the
-C<language.def> files, while the forms with extension recreates only
-the given language file.
+The form C<generate language> recreates both the C<language.dat>, the
+C<language.def> and the C<language.dat.lua>files, while the forms with
+extension recreates only the given language file.
Special consideration for updmap.cfg: in addition to font map files,
this file specifies the setting of five options: C<dvipsPreferOutline>,
@@ -5450,10 +5466,11 @@ Options:
specifies the output file (defaults to the respective location in
C<TEXMFSYSVAR> for C<language*> and C<fmtutil>, and C<TEXMFSYSCONFIG>
for C<updmap>). If C<--dest> is given to C<generate language>, its
-value will be used for the C<language.dat> output, and C<.def> will be
-appended to the value for the name of the C<language.def> output file.
-(This is just to avoid overwriting; if you want a specific name for each
-output file, we recommend invoking C<tlmgr> twice.)
+value will be used for the C<language.dat> output, C<.def> will be
+appended to the value for the name of the C<language.def> output file,
+and C<.dat.lua> to the name of the C<language.dat.lua> file. (This is
+just to avoid overwriting; if you want a specific name for each output
+file, we recommend invoking C<tlmgr> twice.)
=item B<--localcfg> I<local conf file>
@@ -5464,7 +5481,7 @@ location in C<TEXMFLOCAL>).
tells tlmgr to run necessary programs after config files have been
regenerated. These are: C<updmap-sys> after C<generate updmap>,
-C<fmtutil-sys --all> after C<generate fmtutil>,
+C<fmtutil-sys --all> after C<generate fmtutil>,
C<fmtutil-sys --byhyphen .../language.dat> after C<generate language.dat>,
and
C<fmtutil-sys --byhyphen .../language.def> after C<generate language.def>.
@@ -5480,6 +5497,7 @@ The respective locations are as follows:
tex/generic/config/language.dat (and language-local.dat);
tex/generic/config/language.def (and language-local.def);
+ tex/generic/config/language.dat.lua (and language-local.dat.lua);
web2c/fmtutil.cnf (and fmtutil-local.cnf);
web2c/updmap.cfg (and updmap-local.cfg).
diff --git a/Master/texmf/tex/generic/config/language.us.lua b/Master/texmf/tex/generic/config/language.us.lua
new file mode 100644
index 00000000000..2328b8b4916
--- /dev/null
+++ b/Master/texmf/tex/generic/config/language.us.lua
@@ -0,0 +1,25 @@
+-- $Id: $
+--[[
+language.us.dat (and the start of language.dat.lua), used by:
+- a special luatex version of hyphen.cfg (derived from the babel system);
+- a special luatex version of etex.src (from the e-TeX distributon).
+
+See luatex-hyphen.pdf (currently part of the hyph-utf8 package) for details.
+]]
+return {
+ ["english"]={
+ loader="hyphen.tex",
+ special="language0", -- should be dumped in the format
+ lefthyphenmin=2,
+ righthyphenmin=3,
+ synonyms={"usenglish","USenglish","american"},
+ },
+ ["usenglishmax"]={
+ loader="ushyphmax.tex",
+ patterns="hyph-en-US.pat.txt",
+ hyphenation="hyph-en-US.hyp.txt",
+ lefthyphenmin=2,
+ righthyphenmin=3,
+ synonyms={},
+ },
+-- END of language.us.lua