diff options
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 682d85ea03b..097f63d823e 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -451,9 +451,37 @@ sub select_and_rebuild_format { # TODO # original fmtutil.sh was stricter about existence of the hyphen file # not sure how we proceed here; let's implicitly ignore. - $doit = 1 if ($what eq 'byhyphen' && - $whatarg eq - (split(/,/ , $alldata->{'merged'}{$fmt}{$eng}{'hyphen'}))[0]); + # + # original fmtutil.sh seemed to have accepted full path to the hyphen + # file, so that one could give + # --byhyphen /full/path/to/the/hyphen/file + # but this does not work anymore (see Debian bug report #815416) + if ($what eq 'byhyphen') { + my $fmthyp = (split(/,/ , $alldata->{'merged'}{$fmt}{$eng}{'hyphen'}))[0]; + if ($fmthyp ne '-') { + if ($whatarg =~ m!^/!) { + # $whatarg is a full path, we need to expand $fmthyp, too + chomp (my $fmthyplong = `kpsewhich -progname=$fmt -engine=$eng $fmthyp`) ; + if ($fmthyplong) { + $fmthyp = $fmthyplong; + } else { + # we might have searched language.dat --engine=tex --progname=tex + # which will not work. Search again without engine/format + chomp ($fmthyplong = `kpsewhich $fmthyp`) ; + if ($fmthyplong) { + $fmthyp = $fmthyplong; + } else { + # don't give warnings or errors, it might be that the hyphen + # file is not existing at all. See TODO above + #print_deferred_warning("hyphen $fmthyp for $fmt/$eng cannot be expanded.\n"); + } + } + } + if ($whatarg eq $fmthyp) { + $doit = 1; + } + } + } if ($doit) { return rebuild_one_format($fmt,$eng); } else { |