summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-02-22 10:35:56 +0000
committerNorbert Preining <preining@logic.at>2008-02-22 10:35:56 +0000
commit6c5cb191050a8f2e6f6151ea42fa083740b41f30 (patch)
tree33acc368c09dbe19fc74813db11aaaf6947c6984 /Master
parent95d71b7f4b2d40d43a3cce5f7a9ec3c340183fee (diff)
remove fmtutil-sys.pl, and replace it with a texlua script that calls
fmtutil(.exe) as is. We want to call it under win32 and unix as fmtutil-sys git-svn-id: svn://tug.org/texlive/trunk@6722 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-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)
+