summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf/scripts/texlive/lua/getopt.tlu4
-rwxr-xr-xMaster/texmf/scripts/texlive/texconf.tlu38
2 files changed, 19 insertions, 23 deletions
diff --git a/Master/texmf/scripts/texlive/lua/getopt.tlu b/Master/texmf/scripts/texlive/lua/getopt.tlu
index 2327f05698f..d1e90503de7 100644
--- a/Master/texmf/scripts/texlive/lua/getopt.tlu
+++ b/Master/texmf/scripts/texlive/lua/getopt.tlu
@@ -55,6 +55,10 @@ function getopt(spec)
if (v == 0) then
-- boolean argument
retargs[k] = true
+ elseif (v == 1) then
+ -- one single argument
+ retargs[k] = arg[i+1]
+ i = i + 1
else
local bla = {}
for n=1, v do
diff --git a/Master/texmf/scripts/texlive/texconf.tlu b/Master/texmf/scripts/texlive/texconf.tlu
index c7a32f639a4..8a15789815e 100755
--- a/Master/texmf/scripts/texlive/texconf.tlu
+++ b/Master/texmf/scripts/texlive/texconf.tlu
@@ -43,29 +43,6 @@ if string.find(basename, '-sys$') then
sys=true
end
-if arg[1] == '--prog' then
- if arg[2] == nil then
- os.exit(1)
- else
- usageprogname = arg[2]
- -- shift arguments
- for i=1, #arg-2 do
- arg[i] = arg[i+2]
- end
- arg[#arg] = nil
- arg[#arg] = nil
- end
-end
-
-if arg[1] == '--sys' then
- sys=true
- -- shift arguments
- for i=1, #arg-1 do
- arg[i] = arg[i+1]
- end
- arg[#arg] = nil
-end
-
-- this script does NOT appear in the patch, so we cannot use its basename
-- for kpse.set_program_name
-- thus we use simply mktexlsr, which always is in the path and which
@@ -73,6 +50,21 @@ end
-- kpse.set_program_name(filename, basename)
kpse.set_program_name( "mktexlsr" )
+-- set the search path for lua libraries
+texmfmain = kpse.var_value('TEXMFMAIN')
+package.path = texmfmain.."/scripts/texlive/lua/?.tlu"
+require("getopt")
+
+-- do argument processing
+options = getopt ( { sys = 0, prog = 1 } )
+if (options["sys"]) then
+ sys = true
+end
+if (options["prog"]) then
+ usageprogname = options["prog"]
+end
+
+
if (sys) then
texmfconfig=kpse.var_value('TEXMFSYSCONFIG')
else