diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index b416a008242..f2504f62d5c 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -69,6 +69,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::create_updmap($tlpdb,$dest,$localconf); TeXLive::TLUtils::create_language_dat($tlpdb,$dest,$localconf); TeXLive::TLUtils::create_language_def($tlpdb,$dest,$localconf); + TeXLive::TLUtils::create_language_lua($tlpdb,$dest,$localconf); TeXLive::TLUtils::time_estimate($totalsize, $donesize, $starttime) TeXLive::TLUtils::install_packages($from_tlpdb,$media,$to_tlpdb,$what,$opt_src, $opt_doc)>); TeXLive::TLUtils::install_package($what, $filelistref, $target, $platform); @@ -129,6 +130,7 @@ BEGIN { &create_updmap &create_language_dat &create_language_def + &create_language_lua &parse_AddFormat_line &parse_AddHyphen_line &sort_uniq @@ -2344,11 +2346,13 @@ sub make_local_skeleton { =item C<create_language_def($tlpdb, $dest, $localconf)> -These four functions create C<fmtutil.cnf>, C<updmap.cfg>, C<language.dat>, -and C<language.def> respectively, in C<$dest> (which by default is below -C<$TEXMFSYSVAR>). These functions merge the information present in the -TLPDB C<$tlpdb> (formats, maps, hyphenations) with local configuration -additions: C<$localconf>. +=item C<create_language_lua($tlpdb, $dest, $localconf)> + +These five functions create C<fmtutil.cnf>, C<updmap.cfg>, C<language.dat>, +C<language.def>, and C<language.dat.lua> respectively, in C<$dest> (which by +default is below C<$TEXMFSYSVAR>). These functions merge the information +present in the TLPDB C<$tlpdb> (formats, maps, hyphenations) with local +configuration additions: C<$localconf>. Currently the merging is done by omitting disabled entries specified in the local file, and then appending the content of the local @@ -2497,6 +2501,16 @@ sub create_language_def { _create_config_files ($tlpdb, "texmf/tex/generic/config/language.us.def", $dest, $localconf, 1, '%', \@lines, @postlines); } +sub create_language_lua { + my ($tlpdb,$dest,$localconf) = @_; + # no checking for disabled stuff for language.dat and .lua + my @lines = $tlpdb->language_lua_lines( + get_disabled_local_configs($localconf, '--')); + my @postlines = ("}\n"); + _create_config_files ($tlpdb, "texmf/tex/generic/config/language.us.lua", + $dest, $localconf, 0, '--', \@lines, @postlines); +} + sub _create_config_files { my ($tlpdb, $headfile, $dest,$localconf, $keepfirstline, $cc, $tlpdblinesref, @postlines) = @_; my $root = $tlpdb->root; @@ -2533,11 +2547,13 @@ sub _create_config_files { sub parse_AddHyphen_line { my $line = shift; my %ret; + # default values my $default_lefthyphenmin = 2; my $default_righthyphenmin = 3; $ret{"lefthyphenmin"} = $default_lefthyphenmin; $ret{"righthyphenmin"} = $default_righthyphenmin; - for my $p (split(' ', $line)) { + $ret{"synonyms"} = []; + for my $p (quotewords('\s+', 0, "$line")) { my ($a, $b) = split /=/, $p; if ($a eq "name") { if (!$b) { @@ -2563,6 +2579,22 @@ sub parse_AddHyphen_line { $ret{"file"} = $b; next; } + if ($a eq "txtpatt") { + $ret{"txtpatt"} = $b; + next; + } + if ($a eq "txthyph") { + $ret{"txthyph"} = $b; + next; + } + if ($a eq "luaspecial") { + $ret{"luaspecial"} = $b; + next; + } + if ($a eq "databases") { + @{$ret{"databases"}} = split /,/, $b; + next; + } if ($a eq "synonyms") { @{$ret{"synonyms"}} = split /,/, $b; next; @@ -2571,6 +2603,15 @@ sub parse_AddHyphen_line { $ret{"error"} = "Unknown language directive $e"; return %ret; } + # this default value couldn't be set earlier + if (not defined($ret{"databases"})) { + if (defined $ret{"txtpatt"} or defined $ret{"txthyph"} + or defined $ret{"luaspecial"}) { + @{$ret{"databases"}} = qw(dat def lua); + } else { + @{$ret{"databases"}} = qw(dat def); + } + } return %ret; } |