summaryrefslogtreecommitdiff
path: root/print/tex-tetex/patches/patch-bin_fmtutil
blob: 3793eb8ac78d5fbaeb2c98a3ab50a81032c47866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
$NetBSD: patch-bin_fmtutil,v 1.4 2016/06/16 04:06:16 markd Exp $

--- bin/fmtutil.orig	2016-04-22 13:16:07.000000000 +0000
+++ bin/fmtutil
@@ -14,7 +14,7 @@ my $TEXMFROOT;
 
 BEGIN {
   $^W = 1;
-  $TEXMFROOT = `kpsewhich -var-value=TEXMFROOT`;
+  $TEXMFROOT = `@KPSEWHICH@ -var-value=TEXMFROOT`;
   if ($?) {
     die "$0: kpsewhich -var-value=TEXMFROOT failed, aborting early.\n";
   }
@@ -67,12 +67,12 @@ my @deferred_stdout;
 # this function checks by itself whether it is running on windows or not
 reset_root_home();
 
-chomp(our $TEXMFDIST = `kpsewhich --var-value=TEXMFDIST`);
-chomp(our $TEXMFVAR = `kpsewhich -var-value=TEXMFVAR`);
-chomp(our $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`);
-chomp(our $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`);
-chomp(our $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`);
-chomp(our $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`);
+chomp(our $TEXMFDIST = `@KPSEWHICH@ --var-value=TEXMFDIST`);
+chomp(our $TEXMFVAR = `@KPSEWHICH@ -var-value=TEXMFVAR`);
+chomp(our $TEXMFSYSVAR = `@KPSEWHICH@ -var-value=TEXMFSYSVAR`);
+chomp(our $TEXMFCONFIG = `@KPSEWHICH@ -var-value=TEXMFCONFIG`);
+chomp(our $TEXMFSYSCONFIG = `@KPSEWHICH@ -var-value=TEXMFSYSCONFIG`);
+chomp(our $TEXMFHOME = `@KPSEWHICH@ -var-value=TEXMFHOME`);
 
 # make sure that on windows *everything* is in lower case for comparison
 if (win32()) {
@@ -239,7 +239,7 @@ sub main {
       for my $e (sort @all_engines) {
         my $hf = $alldata->{'merged'}{$f}{$e}{'hyphen'};
         next if ($hf eq '-');
-        my $ff = `kpsewhich -progname='$f' -format=tex '$hf'`;
+        my $ff = `@KPSEWHICH@ -progname='$f' -format=tex '$hf'`;
         chomp($ff);
         if ($ff ne "") {
           if ($#all_engines > 0) {
@@ -473,13 +473,13 @@ sub select_and_rebuild_format {
     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`) ;
+        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`) ;
+          chomp ($fmthyplong = `@KPSEWHICH@ $fmthyp`) ;
           if ($fmthyplong) {
             $fmthyp = $fmthyplong;
           } else {
@@ -557,7 +557,7 @@ sub rebuild_one_format {
   }
   
   # check for existence of ini file before doing anything else
-  if (system("kpsewhich -progname=$fmt -format=$kpsefmt $inifile >$nul 2>&1") != 0) {
+  if (system("@KPSEWHICH@ -progname=$fmt -format=$kpsefmt $inifile >$nul 2>&1") != 0) {
     # we didn't find the ini file, skip
     print_deferred_warning("inifile $inifile for $fmt/$eng not found.\n");
     # The original script just skipped it but in TeX Live we expect that
@@ -578,7 +578,7 @@ sub rebuild_one_format {
     $texargs = $addargs;
   }
   if ($pool) {
-    chomp ( my $poolfile = `kpsewhich -progname=$eng $pool.poo 2>$nul` );
+    chomp ( my $poolfile = `@KPSEWHICH@ -progname=$eng $pool.poo 2>$nul` );
     if ($poolfile && -f $poolfile) {
       print_verbose("attempting to create localized format "
                     . "using pool=$pool and tcx=$tcx.\n");
@@ -1002,7 +1002,7 @@ sub determine_config_files {
     # in the list is the one where changes will be written to.
     ($changes_config_file) = @{$opts{'cnffile'}};
   } else {
-    my @all_files = `kpsewhich -all $fn`;
+    my @all_files = `@KPSEWHICH@ -all $fn`;
     chomp(@all_files);
     my @used_files;
     for my $f (@all_files) {
@@ -1012,10 +1012,10 @@ sub determine_config_files {
     my $TEXMFLOCALVAR;
     my @TEXMFLOCAL;
     if (win32()) {
-      chomp($TEXMFLOCALVAR =`kpsewhich --expand-path=\$TEXMFLOCAL`);
+      chomp($TEXMFLOCALVAR =`@KPSEWHICH@ --expand-path=\$TEXMFLOCAL`);
       @TEXMFLOCAL = map { lc } split(/;/ , $TEXMFLOCALVAR);
     } else {
-      chomp($TEXMFLOCALVAR =`kpsewhich --expand-path='\$TEXMFLOCAL'`);
+      chomp($TEXMFLOCALVAR =`@KPSEWHICH@ --expand-path='\$TEXMFLOCAL'`);
       @TEXMFLOCAL = split /:/ , $TEXMFLOCALVAR;
     }
     #