summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu')
-rwxr-xr-xMaster/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu32
1 files changed, 23 insertions, 9 deletions
diff --git a/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu b/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
index 25921db23ea..5a6cd479a7e 100755
--- a/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
+++ b/Master/texmf-dist/scripts/tlgs/gswin32/pdf2dsc.tlu
@@ -21,13 +21,22 @@ function fixwin (args_unix)
end
end
-if os.type == 'windows' then
- gs='gswin32c'
-else
- gs='gs'
+
+local function push (t, ...)
+ local args={...}
+ for _,v in ipairs(args) do
+ if type(v) == 'table' then
+ for _,x in ipairs(v) do
+ t[#t+1]=x
+ end
+ else
+ t[#t+1]=v
+ end
+ end
end
-if #arg == 0 or #arg > 2 then
+
+if #arg ~= 2 then
io.stderr:write('Usage: pdf2dsc input.pdf [output.dsc]\n')
os.exit(1)
end
@@ -39,9 +48,14 @@ else
dscfile=string.gsub(pdffile, '%.%a+$', '.dsc')
end
-command={gs, '-q', '-dNODISPLAY', '-dSAFER', '-dDELAYSAFER',
- '-sPDFname='..pdffile, '-sDSCname='..dscfile, 'pdf2dsc.ps',
- '-c', 'quit'}
+-- setup command
+
+local command={}
+if os.type == 'unix' then command={'gs'} else command={'gswin32c'} end
+
+push(command, '-q', '-dNODISPLAY', '-dSAFER', '-dDELAYSAFER',
+ '-sPDFname='..pdffile, '-sDSCname='..dscfile, 'pdf2dsc.ps',
+ '-c', 'quit')
command=fixwin(command)
@@ -49,7 +63,7 @@ command=fixwin(command)
for i=0, #command do
print (command[i])
end
-os.exit(ret)
+os.exit(0)
--]]
ret=os.spawn(command)