summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-02-22 05:25:30 +0000
committerNorbert Preining <preining@logic.at>2016-02-22 05:25:30 +0000
commit7a22d2161e94794bd18906fffc5781ed37506b2a (patch)
tree7eca05a6dd73aa10557f6a2a66b0b1aea2b3a698
parent1903d130a7dacbda21887723890828cb05ff2a16 (diff)
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
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl34
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 {