texlive/combine.nix: fix bugs in languages filter

Initial language.{dat,def} configuration files provided by
`texlive.hyphen-base` may declare languages that were not part of the
combined packages. Those are filtered out by a sed script that had few
problems:

1) The sed script was generated from a list of potentially non-unique
packages. Every repetition of a select and print clause would produce a
copy of a language declaration in the output file. This became a problem
for update to the 2018-final, the fmtutil would crash from too much
German hyphenation.
2) The select clauses were ambiguous: both '^% from hyphen' and
'^% from hyphen-welsh' will match a line 'from hyphen-welsh'.
This commit is contained in:
Dmitry Kalinkin 2019-03-03 21:36:10 -05:00
parent 30364211e6
commit 8f35ef724a
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333

View File

@ -132,10 +132,15 @@ in buildEnv {
# updmap.cfg seems like not needing changes
# now filter hyphenation patterns, in a hacky way ATM
(let script =
writeText "hyphens.sed" (
lib.concatMapStrings (pkg: "/^\% from ${pkg.pname}/,/^\%/p;\n") pkgList.splitBin.wrong
+ "1,/^\% from/p;" );
(let
pnames = uniqueStrings (map (p: p.pname) pkgList.splitBin.wrong);
script =
writeText "hyphens.sed" (
# pick up the header
"1,/^\% from/p;"
# pick up all sections matching packages that we combine
+ lib.concatMapStrings (pname: "/^\% from ${pname}:$/,/^\%/p;\n") pnames
);
in ''
(
cd ./share/texmf/tex/generic/config/