summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2006-07-28 23:56:00 +0200
committerHans Hagen <pragma@wxs.nl>2006-07-28 23:56:00 +0200
commit4238f3b0f961c9c01da723d16156630f9136da1f (patch)
tree403e1fc764be10085bb3b049841753a3cc007d38 /scripts
parent72646ab6a6f3cd139beecd0407480b03ab49ff10 (diff)
downloadcontext-4238f3b0f961c9c01da723d16156630f9136da1f.tar.gz
stable 2006.07.28 23:56
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/ruby/base/tex.rb8
-rw-r--r--scripts/context/ruby/ctxtools.rb37
-rw-r--r--scripts/context/ruby/texexec.rb11
-rw-r--r--scripts/context/ruby/texmfstart.rb2
-rwxr-xr-xscripts/context/stubs/unix/ctxtools2
-rwxr-xr-xscripts/context/stubs/unix/exatools2
-rwxr-xr-xscripts/context/stubs/unix/makempy2
-rwxr-xr-xscripts/context/stubs/unix/mpstools2
-rwxr-xr-xscripts/context/stubs/unix/mptopdf2
-rwxr-xr-xscripts/context/stubs/unix/pdftools2
-rwxr-xr-xscripts/context/stubs/unix/pstopdf2
-rwxr-xr-xscripts/context/stubs/unix/rlxtools2
-rwxr-xr-xscripts/context/stubs/unix/runtools2
-rwxr-xr-xscripts/context/stubs/unix/texexec2
-rwxr-xr-xscripts/context/stubs/unix/texfont2
-rwxr-xr-xscripts/context/stubs/unix/textools2
-rwxr-xr-xscripts/context/stubs/unix/texutil2
-rwxr-xr-xscripts/context/stubs/unix/tmftools2
-rwxr-xr-xscripts/context/stubs/unix/xmltools2
19 files changed, 43 insertions, 45 deletions
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 04dc4541a..da94eee21 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -185,7 +185,7 @@ class TEX
'modefile', 'result', 'suffix', 'response', 'path',
'filters', 'usemodules', 'environments', 'separation', 'setuppath',
'arguments', 'input', 'output', 'randomseed', 'modes', 'mode', 'filename',
- 'ctxfile', 'printformat', 'paperformat',
+ 'ctxfile', 'printformat', 'paperformat', 'paperoffset',
'timeout'
]
@@standardvars = [
@@ -1289,7 +1289,7 @@ class TEX
# begin getvariable('environments').split(',').uniq.each do |e| opt << "\\useenvironment[#{e}]\n" end ; rescue ; end
opt << "\\endinput\n"
opt.close
- else
+ else
report("unable to write option file #{topname}")
end
rescue
@@ -1726,8 +1726,8 @@ class TEX
end
end
- Kpse.runscript('ctxtools',rawbase,'--purge') if getvariable('purge')
- Kpse.runscript('ctxtools',rawbase,'--purgeall') if getvariable('purgeall')
+ Kpse.runscript('ctxtools',rawbase,'--purge') if getvariable('purge')
+ Kpse.runscript('ctxtools',rawbase,'--purge --all') if getvariable('purgeall')
when 'latex' then
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb
index d04688890..48bce8146 100644
--- a/scripts/context/ruby/ctxtools.rb
+++ b/scripts/context/ruby/ctxtools.rb
@@ -2314,31 +2314,28 @@ class Commands
end
def locatedlocaltree
- return `kpsewhich --expand-var $TEXMFLOCAL`.chomp rescue nil
+ tree = `kpsewhich --expand-path $TEXMFLOCAL`.chomp rescue nil
+ unless tree && FileTest.directory?(tree) then
+ tree = `kpsewhich --expand-path $TEXMF`.chomp rescue nil
+ end
+ return tree
end
def extractarchive(archive)
- if FileTest.file?(archive) then
- begin
- system("unzip -uo #{archive}")
- rescue
- report("fatal error, make sure that you have 'unzip' in your path")
- return false
- else
- if System.unix? then
- begin
- system("chmod +x scripts/context/unix/stubs/*")
- rescue
- report("change x-permissions of 'scripts/context/unix/stubs/*' manually")
- end
- end
- return true
- end
- else
- report("fatal error, '{archive}' has not been downloaded")
+ unless FileTest.file?(archive) then
+ report("fatal error, '#{archive}' has not been downloaded")
+ return false
+ end
+ unless system("unzip -uo #{archive}") then
+ report("fatal error, make sure that you have 'unzip' in your path")
return false
end
- end
+ stubs = "scripts/context/stubs/unix/*"
+ if System.unix? and not system("chmod +x #{stubs}") then
+ report("change x-permissions of '#{stubs}' manually")
+ end
+ return true
+ end
def remakeformats
return system("texmfstart texexec --make --all")
diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb
index 14bc15662..1a7175f23 100644
--- a/scripts/context/ruby/texexec.rb
+++ b/scripts/context/ruby/texexec.rb
@@ -285,6 +285,7 @@ class Commands
f.close
job.setvariable('interface','english')
job.setvariable('simplerun',true)
+ job.setvariable('arrange',true)
# job.setvariable('nooptionfile',true)
job.setvariable('files',[job.tempfilename])
job.processtex
@@ -376,7 +377,7 @@ class Commands
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
scale = @commandline.checkedoption('scale')
- scale = (scale * 1000).to_i if scale < 10
+ scale = (scale * 1000).to_i if scale.to_i < 10
paperoffset = @commandline.checkedoption('paperoffset', '0cm')
f << "\\starttext\n"
files.each do |filename|
@@ -399,7 +400,7 @@ class Commands
f << "\\setupexternalfigures\n"
f << " [directory=]\n"
f << "\\copypages\n"
- f << " [#[filename}]\n"
+ f << " [#{filename}]\n"
f << " [scale=#{scale},\n"
f << " marking=on,\n" if @commandline.option('markings')
f << " size=trimbox,\n" if trim
@@ -601,12 +602,12 @@ class Commands
end
-# so far for compatibility
+# so far for compatibility, will move to tex
@@extrastringvars = [
'pages', 'background', 'backspace', 'topspace', 'boxtype', 'tempdir','bannerheight',
- 'printformat', 'paperformat', 'method', 'scale', 'selection',
- 'combination', 'paperoffset', 'textwidth', 'addempty', 'logfile',
+ 'printformat', 'method', 'scale', 'selection',
+ 'combination', 'textwidth', 'addempty', 'logfile',
'startline', 'endline', 'startcolumn', 'endcolumn', 'scale'
]
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index 1f76d703f..411cb9248 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -2222,7 +2222,7 @@ def make(filename,windows=false,linux=false,remove=false)
elsif linux && f = open(basename,'w') then
f.binmode
f.write("#!/bin/sh\012")
- f.write("#{program} #{callname} $@\012")
+ f.write("#{program} #{callname} \"$@\"\012")
f.close
report("unix stub '#{basename}' made (calls #{callname})")
end
diff --git a/scripts/context/stubs/unix/ctxtools b/scripts/context/stubs/unix/ctxtools
index 5a6a1feb5..84e47bbee 100755
--- a/scripts/context/stubs/unix/ctxtools
+++ b/scripts/context/stubs/unix/ctxtools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart ctxtools.rb $@
+texmfstart ctxtools.rb "$@"
diff --git a/scripts/context/stubs/unix/exatools b/scripts/context/stubs/unix/exatools
index cededbb57..50ff0f07e 100755
--- a/scripts/context/stubs/unix/exatools
+++ b/scripts/context/stubs/unix/exatools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart exatools.rb $@
+texmfstart exatools.rb "$@"
diff --git a/scripts/context/stubs/unix/makempy b/scripts/context/stubs/unix/makempy
index c30a261f0..4bf7a1af2 100755
--- a/scripts/context/stubs/unix/makempy
+++ b/scripts/context/stubs/unix/makempy
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart makempy.pl $@
+texmfstart makempy.pl "$@"
diff --git a/scripts/context/stubs/unix/mpstools b/scripts/context/stubs/unix/mpstools
index 68fd485bc..b4c8f6345 100755
--- a/scripts/context/stubs/unix/mpstools
+++ b/scripts/context/stubs/unix/mpstools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart mpstools.rb $@
+texmfstart mpstools.rb "$@"
diff --git a/scripts/context/stubs/unix/mptopdf b/scripts/context/stubs/unix/mptopdf
index a29448782..980a3123d 100755
--- a/scripts/context/stubs/unix/mptopdf
+++ b/scripts/context/stubs/unix/mptopdf
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart mptopdf.pl $@
+texmfstart mptopdf.pl "$@"
diff --git a/scripts/context/stubs/unix/pdftools b/scripts/context/stubs/unix/pdftools
index fc6b9e864..92ee803a8 100755
--- a/scripts/context/stubs/unix/pdftools
+++ b/scripts/context/stubs/unix/pdftools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart pdftools.rb $@
+texmfstart pdftools.rb "$@"
diff --git a/scripts/context/stubs/unix/pstopdf b/scripts/context/stubs/unix/pstopdf
index e1f0375e5..5b38ed426 100755
--- a/scripts/context/stubs/unix/pstopdf
+++ b/scripts/context/stubs/unix/pstopdf
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart pstopdf.rb $@
+texmfstart pstopdf.rb "$@"
diff --git a/scripts/context/stubs/unix/rlxtools b/scripts/context/stubs/unix/rlxtools
index 6cd5db89f..41cea40fc 100755
--- a/scripts/context/stubs/unix/rlxtools
+++ b/scripts/context/stubs/unix/rlxtools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart rlxtools.rb $@
+texmfstart rlxtools.rb "$@"
diff --git a/scripts/context/stubs/unix/runtools b/scripts/context/stubs/unix/runtools
index 3e4e2c505..ff9a33379 100755
--- a/scripts/context/stubs/unix/runtools
+++ b/scripts/context/stubs/unix/runtools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart runtools.rb $@
+texmfstart runtools.rb "$@"
diff --git a/scripts/context/stubs/unix/texexec b/scripts/context/stubs/unix/texexec
index a8e297307..215817290 100755
--- a/scripts/context/stubs/unix/texexec
+++ b/scripts/context/stubs/unix/texexec
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart texexec.rb $@
+texmfstart texexec.rb "$@"
diff --git a/scripts/context/stubs/unix/texfont b/scripts/context/stubs/unix/texfont
index ec1bd57d5..a91f786e3 100755
--- a/scripts/context/stubs/unix/texfont
+++ b/scripts/context/stubs/unix/texfont
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart texfont.pl $@
+texmfstart texfont.pl "$@"
diff --git a/scripts/context/stubs/unix/textools b/scripts/context/stubs/unix/textools
index 5078ebce0..7445eac37 100755
--- a/scripts/context/stubs/unix/textools
+++ b/scripts/context/stubs/unix/textools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart textools.rb $@
+texmfstart textools.rb "$@"
diff --git a/scripts/context/stubs/unix/texutil b/scripts/context/stubs/unix/texutil
index 773176da5..607154af0 100755
--- a/scripts/context/stubs/unix/texutil
+++ b/scripts/context/stubs/unix/texutil
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart texutil.rb $@
+texmfstart texutil.rb "$@"
diff --git a/scripts/context/stubs/unix/tmftools b/scripts/context/stubs/unix/tmftools
index 9b52a5e53..7531a9663 100755
--- a/scripts/context/stubs/unix/tmftools
+++ b/scripts/context/stubs/unix/tmftools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart tmftools.rb $@
+texmfstart tmftools.rb "$@"
diff --git a/scripts/context/stubs/unix/xmltools b/scripts/context/stubs/unix/xmltools
index 7e8c174ca..03086d043 100755
--- a/scripts/context/stubs/unix/xmltools
+++ b/scripts/context/stubs/unix/xmltools
@@ -1,2 +1,2 @@
#!/bin/sh
-texmfstart xmltools.rb $@
+texmfstart xmltools.rb "$@"