summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-04-26 00:34:54 +0000
committerKarl Berry <karl@freefriends.org>2008-04-26 00:34:54 +0000
commitd18a85166ab3f33952f42e91c0cf1266db1d3918 (patch)
treefdd9d05c52deda4a5506b6f21a743895c13279e5
parent419a1f0cf66ecfd6f2198bc991c529b73dcc9b15 (diff)
make all wrappers the same file
git-svn-id: svn://tug.org/texlive/trunk@7660 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/bin/win32/a2ping.texlua92
-rwxr-xr-xMaster/bin/win32/e2pall.texlua92
-rwxr-xr-xMaster/bin/win32/epstopdf.texlua4
-rwxr-xr-xMaster/bin/win32/fmtutil-sys.texlua2
-rwxr-xr-xMaster/bin/win32/getnonfreefonts-sys.texlua2
-rwxr-xr-xMaster/bin/win32/getnonfreefonts.texlua4
-rwxr-xr-xMaster/bin/win32/makeglossaries.texlua92
-rwxr-xr-xMaster/bin/win32/pdfcrop.texlua92
-rwxr-xr-xMaster/bin/win32/pdfthumb.texlua65
-rwxr-xr-xMaster/bin/win32/perltex.texlua92
-rwxr-xr-xMaster/bin/win32/pkfix.texlua92
-rwxr-xr-xMaster/bin/win32/ppower4.texlua65
-rwxr-xr-xMaster/bin/win32/ps2eps.texlua92
-rwxr-xr-xMaster/bin/win32/texcount.texlua92
-rwxr-xr-xMaster/bin/win32/texdoctk.texlua4
-rwxr-xr-xMaster/bin/win32/texindy.texlua2
-rwxr-xr-xMaster/bin/win32/thumbpdf.texlua4
-rwxr-xr-xMaster/bin/win32/tlmgr.texlua4
-rwxr-xr-xMaster/bin/win32/updmap-sys.texlua2
-rwxr-xr-xMaster/bin/win32/updmap.texlua2
-rwxr-xr-xMaster/bin/win32/vpe.texlua92
-rwxr-xr-xMaster/bin/win32/xindy.texlua2
-rwxr-xr-xMaster/tlpkg/bin/check-wrapper-consistency84
23 files changed, 1042 insertions, 32 deletions
diff --git a/Master/bin/win32/a2ping.texlua b/Master/bin/win32/a2ping.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/a2ping.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/e2pall.texlua b/Master/bin/win32/e2pall.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/e2pall.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/epstopdf.texlua b/Master/bin/win32/epstopdf.texlua
index e6d974e19d2..45aa25162e5 100755
--- a/Master/bin/win32/epstopdf.texlua
+++ b/Master/bin/win32/epstopdf.texlua
@@ -1,8 +1,8 @@
#! /usr/bin/env texlua
--*-Lua-*-
--- $Id$
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/fmtutil-sys.texlua b/Master/bin/win32/fmtutil-sys.texlua
index e6d974e19d2..81c8a83940c 100755
--- a/Master/bin/win32/fmtutil-sys.texlua
+++ b/Master/bin/win32/fmtutil-sys.texlua
@@ -2,7 +2,7 @@
--*-Lua-*-
-- $Id$
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/getnonfreefonts-sys.texlua b/Master/bin/win32/getnonfreefonts-sys.texlua
index e6d974e19d2..81c8a83940c 100755
--- a/Master/bin/win32/getnonfreefonts-sys.texlua
+++ b/Master/bin/win32/getnonfreefonts-sys.texlua
@@ -2,7 +2,7 @@
--*-Lua-*-
-- $Id$
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/getnonfreefonts.texlua b/Master/bin/win32/getnonfreefonts.texlua
index e6d974e19d2..45aa25162e5 100755
--- a/Master/bin/win32/getnonfreefonts.texlua
+++ b/Master/bin/win32/getnonfreefonts.texlua
@@ -1,8 +1,8 @@
#! /usr/bin/env texlua
--*-Lua-*-
--- $Id$
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/makeglossaries.texlua b/Master/bin/win32/makeglossaries.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/makeglossaries.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/pdfcrop.texlua b/Master/bin/win32/pdfcrop.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/pdfcrop.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/pdfthumb.texlua b/Master/bin/win32/pdfthumb.texlua
index 5d524a0a66d..45aa25162e5 100755
--- a/Master/bin/win32/pdfthumb.texlua
+++ b/Master/bin/win32/pdfthumb.texlua
@@ -1,11 +1,11 @@
-#!/usr/bin/env texlua
+#! /usr/bin/env texlua
--*-Lua-*-
--- $Id: .texlua 6969 2008-03-14 22:17:00Z reinhardk $
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2008 Reinhard Kotucha.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
--- Launch pdfthumb
+-- Wrapper for scripts.
function fixwin(args_unix)
if os.type == 'windows' then
@@ -20,11 +20,60 @@ function fixwin(args_unix)
end
end
-kpse.set_program_name('pdfthumb.texlua', 'pdfthumb')
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
-jarfile=kpse.find_file('pp4p.jar', 'texmfscripts')
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
-command={'java', '-cp', jarfile, 'de.tu_darmstadt.sp.pdftools.ThumbGen'}
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
for i=1, #arg do
command[#command+1]=arg[i]
@@ -32,7 +81,7 @@ end
command=fixwin(command)
---[[ prepend an additional hyphen to activate this code
+--[[ Prepend an additional hyphen to activate this code.
for i=0, #command do
print (command[i])
end
diff --git a/Master/bin/win32/perltex.texlua b/Master/bin/win32/perltex.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/perltex.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/pkfix.texlua b/Master/bin/win32/pkfix.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/pkfix.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/ppower4.texlua b/Master/bin/win32/ppower4.texlua
index 06e6ff454ff..45aa25162e5 100755
--- a/Master/bin/win32/ppower4.texlua
+++ b/Master/bin/win32/ppower4.texlua
@@ -1,11 +1,11 @@
-#!/usr/bin/env texlua
+#! /usr/bin/env texlua
--*-Lua-*-
--- $Id$
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2008 Reinhard Kotucha.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
--- Launch ppower4
+-- Wrapper for scripts.
function fixwin(args_unix)
if os.type == 'windows' then
@@ -20,11 +20,60 @@ function fixwin(args_unix)
end
end
-kpse.set_program_name('ppower4.texlua', 'ppower4')
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
-jarfile=kpse.find_file('pp4p.jar', 'texmfscripts')
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
-command={'java', '-jar', jarfile}
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
for i=1, #arg do
command[#command+1]=arg[i]
@@ -32,7 +81,7 @@ end
command=fixwin(command)
---[[ prepend an additional hyphen to activate this code
+--[[ Prepend an additional hyphen to activate this code.
for i=0, #command do
print (command[i])
end
diff --git a/Master/bin/win32/ps2eps.texlua b/Master/bin/win32/ps2eps.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/ps2eps.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/texcount.texlua b/Master/bin/win32/texcount.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/texcount.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/texdoctk.texlua b/Master/bin/win32/texdoctk.texlua
index e6d974e19d2..45aa25162e5 100755
--- a/Master/bin/win32/texdoctk.texlua
+++ b/Master/bin/win32/texdoctk.texlua
@@ -1,8 +1,8 @@
#! /usr/bin/env texlua
--*-Lua-*-
--- $Id$
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/texindy.texlua b/Master/bin/win32/texindy.texlua
index e6d974e19d2..81c8a83940c 100755
--- a/Master/bin/win32/texindy.texlua
+++ b/Master/bin/win32/texindy.texlua
@@ -2,7 +2,7 @@
--*-Lua-*-
-- $Id$
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/thumbpdf.texlua b/Master/bin/win32/thumbpdf.texlua
index e6d974e19d2..45aa25162e5 100755
--- a/Master/bin/win32/thumbpdf.texlua
+++ b/Master/bin/win32/thumbpdf.texlua
@@ -1,8 +1,8 @@
#! /usr/bin/env texlua
--*-Lua-*-
--- $Id$
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/tlmgr.texlua b/Master/bin/win32/tlmgr.texlua
index 89c8f854618..45aa25162e5 100755
--- a/Master/bin/win32/tlmgr.texlua
+++ b/Master/bin/win32/tlmgr.texlua
@@ -1,8 +1,8 @@
#! /usr/bin/env texlua
--*-Lua-*-
--- $Id: xindy.texlua 7484 2008-04-18 05:44:51Z vvv $
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/updmap-sys.texlua b/Master/bin/win32/updmap-sys.texlua
index e6d974e19d2..81c8a83940c 100755
--- a/Master/bin/win32/updmap-sys.texlua
+++ b/Master/bin/win32/updmap-sys.texlua
@@ -2,7 +2,7 @@
--*-Lua-*-
-- $Id$
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/updmap.texlua b/Master/bin/win32/updmap.texlua
index e6d974e19d2..81c8a83940c 100755
--- a/Master/bin/win32/updmap.texlua
+++ b/Master/bin/win32/updmap.texlua
@@ -2,7 +2,7 @@
--*-Lua-*-
-- $Id$
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/bin/win32/vpe.texlua b/Master/bin/win32/vpe.texlua
new file mode 100755
index 00000000000..45aa25162e5
--- /dev/null
+++ b/Master/bin/win32/vpe.texlua
@@ -0,0 +1,92 @@
+#! /usr/bin/env texlua
+--*-Lua-*-
+-- $Id: tl-w32-wrapper.texlua 7659 2008-04-26 00:33:32Z karl $
+
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
+-- You may freely use, modify and/or distribute this file.
+
+-- Wrapper for scripts.
+
+function fixwin(args_unix)
+ if os.type == 'windows' then
+ local args_win={} -- new table
+ args_win[0]=args_unix[1]
+ for i=1, #args_unix do
+ args_win[i]='"'..args_unix[i]..'"'
+ end
+ return args_win
+ else
+ return args_unix
+ end
+end
+
+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$', ''))
+
+sys=false
+
+if string.find(basename, '-sys$') then
+ basename=select(1, string.gsub(basename, '-sys$', ''))
+ sys=true
+end
+
+kpse.set_program_name(filename, basename)
+TEXDIR=kpse.var_value('SELFAUTOPARENT')
+BINDIR=kpse.var_value('SELFAUTOLOC')
+
+perlbin=TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
+
+os.setenv('PATH', TEXDIR..'/tlpkg/tlgs/bin;'..
+ TEXDIR..'/tlpkg/installer;'..
+ os.getenv('PATH'))
+
+os.setenv('WGETRC', TEXDIR..'/tlpkg/installer/wgetrc')
+os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
+os.setenv('GS_LIB', TEXDIR..'/tlpkg/tlgs/lib;'..TEXDIR..'/tlpkg/tlgs/fonts')
+
+if sys then
+ os.setenv('TEXMFVAR', kpse.var_value('TEXMFSYSVAR'))
+ os.setenv('TEXMFCONFIG', kpse.var_value('TEXMFSYSCONFIG'))
+ os.setenv('TEX_SYS_PROG', 'true')
+end
+
+if sys and lfs.isfile(BINDIR..'/'..basename..'.exe') then
+ command={BINDIR..'/'..basename..'.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'-bin.exe') then
+ command={BINDIR..'/'..basename..'-bin.exe'}
+elseif lfs.isfile(BINDIR..'/'..basename..'.pl') then
+ script=BINDIR..'/'..basename..'.pl'
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.pl', 'texmfscripts') then
+ script=kpse.find_file(basename..'.pl', 'texmfscripts')
+ command={perlbin, script}
+elseif kpse.find_file(basename..'.tlu', 'texmfscripts') then
+ script=kpse.find_file(basename..'.tlu', 'texmfscripts')
+ command={'texlua', script}
+else
+ io.stderr:write(filename..'.texlua: '..basename..
+ ': No appropriate script found.\n')
+end
+
+for i=1, #arg do
+ command[#command+1]=arg[i]
+end
+
+command=fixwin(command)
+
+--[[ Prepend an additional hyphen to activate this code.
+for i=0, #command do
+ print (command[i])
+end
+os.exit(ret)
+--]]
+
+ret=os.spawn(command)
+os.exit(ret)
diff --git a/Master/bin/win32/xindy.texlua b/Master/bin/win32/xindy.texlua
index e6d974e19d2..81c8a83940c 100755
--- a/Master/bin/win32/xindy.texlua
+++ b/Master/bin/win32/xindy.texlua
@@ -2,7 +2,7 @@
--*-Lua-*-
-- $Id$
--- Copyright (C) 2007 Reinhard Kotucha, Norbert Preining.
+-- Copyright (C) 2007, 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
-- Wrapper for scripts.
diff --git a/Master/tlpkg/bin/check-wrapper-consistency b/Master/tlpkg/bin/check-wrapper-consistency
new file mode 100755
index 00000000000..f3025c2db1f
--- /dev/null
+++ b/Master/tlpkg/bin/check-wrapper-consistency
@@ -0,0 +1,84 @@
+#!/usr/bin/env perl
+# $Id$
+# Copyright 2008 TeX Users Group.
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+# Check that the same set of files are wrappers on w32 and symlinks on
+# all others.
+
+BEGIN {
+ $^W = 1;
+ ($mydir = $0) =~ s,/[^/]*$,,;
+ unshift (@INC, "$mydir/..");
+}
+
+use Getopt::Long;
+use Pod::Usage;
+
+our $mydir;
+my $help = 0;
+
+GetOptions("help|?" => \$help) or pod2usage(1);
+pod2usage(-exitstatus => 0, -verbose => 2) if $help;
+
+exit (&main ());
+
+sub main
+{
+ my $err = 0;
+
+ chomp (my $Master = `cd $mydir/../.. && pwd`);
+ my $bindir = "$Master/bin";
+ chdir ($bindir) || die "chdir($bindir) failed: $!";
+
+ my %w = &unx_wrapper_entries ("i386-linux");
+
+ $cww = "$Master/../Build/source/texk/texlive/tl-w32-wrapper.texlua";
+ $err += &check_w32 ("win32", $cww, %w);
+
+ return $err;
+}
+
+
+
+# return all symlinks starting with ".." in DIR as a hash, with symlink
+# targets as the values.
+#
+sub unx_wrapper_entries
+{
+ my ($DIR) = @_;
+ my %ret;
+
+ local *DIR;
+ opendir (DIR, $DIR) || die "opendir($DIR) failed: $!";
+ while (my $ent = readdir (DIR)) {
+ my $file = "$DIR/$ent";
+ next unless -l $file; # skip all but symlinks
+
+ my $target = readlink ($file);
+ die "readlink($file) failed: $!" if !defined ($target);
+ next unless $target =~ /^\.\./; # skip all but .. symlinks
+
+ $ret{$ent} = $target; # remember name and link target
+ }
+ closedir (DIR) || warn "closedir($DIR) failed: $!";
+
+ return %ret;
+}
+
+
+
+# windows is special, as usual. given the list of wrappers in UW, check
+# that each of those entries exists in W32DIR and is a copy of the
+# canonical w32 wrapper specified in W32CANONICAL.
+#
+sub check_w32
+{
+ my ($w32dir, $w32canonical, %uw) = @_;
+
+ for my $k (sort keys %uw) {
+ system ("cmp $w32dir/$k.texlua $w32canonical");
+ #print "$k -> $uw{$k}\n";
+ }
+}