summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/bin/win32/fmtutil-sys.pl21
-rwxr-xr-xMaster/bin/win32/fmtutil-sys.texlua40
2 files changed, 40 insertions, 21 deletions
diff --git a/Master/bin/win32/fmtutil-sys.pl b/Master/bin/win32/fmtutil-sys.pl
deleted file mode 100755
index ad527a9b22a..00000000000
--- a/Master/bin/win32/fmtutil-sys.pl
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env perl
-
-# fmtutil-sys: wrapper script for fmtutil with TEXMFVAR and
-# TEXMFCONFIG set to TEXMFSYSVAR / TEXMFSYSCONFIG
-
-# Copyright 2007 Reinhard Kotucha
-# This file is licensed under the GNU General Public License version 2
-# or any later version.
-
-# Originally provided as a shell script written by Thomas Esser.
-$^W=1;
-
-my $TEXMFSYSVAR=`kpsewhich -var-value TEXMFSYSVAR`;
-chomp ("$TEXMFSYSVAR");
-$ENV{"$TEXMFVAR"}="$TEXMFSYSVAR";
-
-my $TEXMFSYSCONFIG=`kpsewhich -var-value TEXMFSYSVAR`;
-chomp ("$TEXMFSYSCONFIG");
-$ENV{"$TEXMFCONFIG"}="$TEXMFSYSCONFIG";
-
-exec ('fmtutil', @ARGV);
diff --git a/Master/bin/win32/fmtutil-sys.texlua b/Master/bin/win32/fmtutil-sys.texlua
new file mode 100755
index 00000000000..3b2032a15bc
--- /dev/null
+++ b/Master/bin/win32/fmtutil-sys.texlua
@@ -0,0 +1,40 @@
+#!/xusr/bin/env texlua
+--*-Lua-*-
+-- $Id: fmtutil-sys.texlua 6607 2008-02-11 15:37:39Z siepo $
+
+-- Copyright (C) 2008 Reinhard Kotucha, Norbert Preining
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for Perl scripts.
+
+
+if string.find(arg[0], "/") then -- UNIX path
+ filename=select(1, string.gsub(arg[0], ".*/", ""))
+elseif string.find(arg[0], "\\") then -- Windows path
+ filename=select(1, string.gsub(arg[0], ".*\\", ""))
+else -- no path
+ filename=arg[0]
+end
+
+basename=select(1, string.gsub(filename, "\.texlua$", ""))
+
+-- basename="fmtutil-sys"
+
+kpse.set_program_name(filename)
+
+if string.find(basename, "-sys$") then
+ basename=select(1, string.gsub(basename, "-sys$", ""))
+ os.setenv("TEXMFVAR", kpse.var_value("TEXMFSYSVAR"))
+ os.setenv("TEXMFCONFIG", kpse.var_value("TEXMFSYSCONFIG"))
+end
+
+command[0] = "fmtutil"
+command[1] = "fmtutil"
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+ret=os.spawn(command)
+os.exit(ret)
+