From 7a22d2161e94794bd18906fffc5781ed37506b2a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 22 Feb 2016 05:25:30 +0000 Subject: fmtutil: allow for full path in hyphen file when --byhyphen As with the shell version, we want to allow for fmtutil -byhyphen /path/to/hyphen/file This patch fixes this usage git-svn-id: svn://tug.org/texlive/trunk@39812 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/fmtutil.pl | 34 +++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'Master') 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 { -- cgit v1.2.3