summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2007-07-24 14:36:00 +0200
committerHans Hagen <pragma@wxs.nl>2007-07-24 14:36:00 +0200
commitd1094c61b213e9897b6191965d07a5c250f0be9b (patch)
tree528012db40aa6daff5f13e525098050cd358d91f /scripts
parent846455e735faabe2352a1c37c2733a4256dde4c0 (diff)
downloadcontext-d1094c61b213e9897b6191965d07a5c250f0be9b.tar.gz
stable 2007.07.24 14:36
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/ruby/base/tex.rb51
-rw-r--r--scripts/context/ruby/base/texutil.rb11
-rw-r--r--scripts/context/ruby/ctxtools.rb2
-rw-r--r--scripts/context/ruby/texexec.rb3
-rw-r--r--scripts/context/ruby/texmfstart.rb22
-rwxr-xr-xscripts/context/stubs/mswin/luatools.bat2
-rwxr-xr-xscripts/context/stubs/mswin/mtxtools.bat2
-rwxr-xr-xscripts/context/stubs/unix/luatools2
-rwxr-xr-xscripts/context/stubs/unix/mtxtools2
9 files changed, 45 insertions, 52 deletions
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 6c77ab059..ceb9473c0 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -610,15 +610,12 @@ class TEX
report('using existing database')
else
report('updating file database')
- Kpse.update
+ Kpse.update # obsolete here
if getvariable('luatex') then
begin
- luatools = `texmfstart luatools --format=texmfscripts luatools.lua`.chomp.strip
- unless luatools.empty? then
- runcommand(["luatex","--luaonly #{luatools}","--generate","--verbose"])
- end
+ runcommand(["luatools","--generate","--verbose"])
rescue
- report("run 'luatex --luaonly pathto/luatools.lua --generate' manually")
+ report("run 'luatools --generate' manualy")
exit
end
end
@@ -816,7 +813,7 @@ class TEX
private
- def makeuserfile
+ def makeuserfile # not used in luatex (yet)
language = getvariable('language')
mainlanguage = getvariable('mainlanguage')
bodyfont = getvariable('bodyfont')
@@ -1159,18 +1156,22 @@ class TEX
public
- def run_luatools(args)
+ # def run_luatools(args)
# dirty trick: we know that the lua path is relative to the ruby path; of course this
# will not work well when stubs are used
- [(ENV["_CTX_K_S_texexec_"] or ENV["_CTX_K_S_THREAD_"] or ENV["TEXMFSTART.THREAD"]), File.dirname($0)].each do |path|
- if path then
- script = "#{path}/../lua/luatools.lua"
- if FileTest.file?(script) then
- return runcommand("luatex --luaonly #{script} #{args}")
- end
- end
- end
- return runcommand("texmfstart luatools #{args}")
+ # [(ENV["_CTX_K_S_texexec_"] or ENV["_CTX_K_S_THREAD_"] or ENV["TEXMFSTART.THREAD"]), File.dirname($0)].each do |path|
+ # if path then
+ # script = "#{path}/../lua/luatools.lua"
+ # if FileTest.file?(script) then
+ # return runcommand("luatex --luaonly #{script} #{args}")
+ # end
+ # end
+ # end
+ # return runcommand("texmfstart luatools #{args}")
+ # end
+
+ def run_luatools(args)
+ return runcommand("luatools #{args}")
end
def processmpgraphic
@@ -1789,10 +1790,10 @@ end
forcexml = getvariable('forcexml')
- # if dummyfile || forcexml then # after ctx?
- # jobsuffix = makestubfile(rawname,rawbase,forcexml)
- # checkxmlfile(rawname)
- # end
+if dummyfile || forcexml then # after ctx?
+ jobsuffix = makestubfile(rawname,rawbase,forcexml)
+ checkxmlfile(rawname)
+end
# preprocess files
@@ -1864,10 +1865,10 @@ end
globalfile = getvariable('globalfile')
forcexml = getvariable('forcexml') # can be set in ctx file
- if dummyfile || forcexml then # after ctx?
- jobsuffix = makestubfile(rawname,rawbase,forcexml)
- checkxmlfile(rawname)
- end
+if dummyfile || forcexml then # after ctx?
+ jobsuffix = makestubfile(rawname,rawbase,forcexml)
+ checkxmlfile(rawname)
+end
result = File.unixfied(result)
diff --git a/scripts/context/ruby/base/texutil.rb b/scripts/context/ruby/base/texutil.rb
index 31f0efb51..726e31381 100644
--- a/scripts/context/ruby/base/texutil.rb
+++ b/scripts/context/ruby/base/texutil.rb
@@ -433,8 +433,8 @@ class TeXUtil
def MyExtras::writer(logger,handle)
handle << logger.banner("programs: #{@@programs.size}")
- @@programs.each do |p|
- handle << "% #{p} (#{@@programs[p.to_i]})\n"
+ @@programs.each_with_index do |cmd, p|
+ handle << "% #{p+1} (#{cmd})\n"
end
end
@@ -447,12 +447,11 @@ class TeXUtil
end
def MyExtras::finalizer(logger)
-unless (ENV["CTX.TEXUTIL.EXTRAS"] =~ /^(no|off|false|0)$/io) || (ENV["CTX_TEXUTIL_EXTRAS"] =~ /^(no|off|false|0)$/io) then
- @@programs.each do |p|
- cmd = @@programs[p.to_i]
+ unless (ENV["CTX.TEXUTIL.EXTRAS"] =~ /^(no|off|false|0)$/io) || (ENV["CTX_TEXUTIL_EXTRAS"] =~ /^(no|off|false|0)$/io) then
+ @@programs.each do |cmd|
logger.report("running #{cmd}")
system(cmd)
-end
+ end
end
end
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb
index 27240583a..85b079ee1 100644
--- a/scripts/context/ruby/ctxtools.rb
+++ b/scripts/context/ruby/ctxtools.rb
@@ -534,7 +534,7 @@ class Commands
]
$dontasksuffixes = [
"mp(graph|run)\\.mp", "mp(graph|run)\\.mpd", "mp(graph|run)\\.mpo", "mp(graph|run)\\.mpy",
- "mp(graph|run)\\.\\d+",
+ "mp(graph|run)\\.\\d+", "mp(graph|run)\\.mp.keep",
"xlscript\\.xsl"
]
$forsuresuffixes = [
diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb
index 568bbee1c..3ba3388f0 100644
--- a/scripts/context/ruby/texexec.rb
+++ b/scripts/context/ruby/texexec.rb
@@ -430,10 +430,11 @@ class Commands
if f = File.open(job.tempfilename('tex'),'w') then
scale = @commandline.checkedoption('scale')
begin
- scale = (scale.to_i * 1000).to_i if scale.to_i < 10
+ scale = (scale.to_f * 1000.0).to_i if scale.to_i < 10
rescue
scale = 1000
end
+ scale = scale.to_i
paperoffset = @commandline.checkedoption('paperoffset', '0cm')
f << "\\starttext\n"
files.each do |filename|
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index f60011d1d..4273de7bc 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -43,7 +43,7 @@ require "md5"
# kpse_merge_start
-# kpse_merge_file: 'C:/data/develop/context/ruby/base/kpseremote.rb'
+# kpse_merge_file: 'c:/data/develop/context/ruby/base/kpseremote.rb'
# kpse_merge_done: require 'base/kpsefast'
@@ -163,7 +163,7 @@ class KpseRemote
end
-# kpse_merge_file: 'C:/data/develop/context/ruby/base/kpsefast.rb'
+# kpse_merge_file: 'c:/data/develop/context/ruby/base/kpsefast.rb'
# module : base/kpsefast
# copyright : PRAGMA Advanced Document Engineering
@@ -1097,7 +1097,7 @@ end
-# kpse_merge_file: 'C:/data/develop/context/ruby/base/kpse/drb.rb'
+# kpse_merge_file: 'c:/data/develop/context/ruby/base/kpse/drb.rb'
require 'drb'
# kpse_merge_done: require 'base/kpse/trees'
@@ -1157,7 +1157,7 @@ end
#
-# kpse_merge_file: 'C:/data/develop/context/ruby/base/kpse/trees.rb'
+# kpse_merge_file: 'c:/data/develop/context/ruby/base/kpse/trees.rb'
require 'monitor'
# kpse_merge_done: require 'base/kpsefast'
@@ -1245,7 +1245,7 @@ class KpseTrees < Monitor
end
-# kpse_merge_file: 'C:/data/develop/context/ruby/base/kpsedirect.rb'
+# kpse_merge_file: 'c:/data/develop/context/ruby/base/kpsedirect.rb'
class KpseDirect
@@ -1283,7 +1283,7 @@ class KpseDirect
end
-# kpse_merge_file: 'C:/data/develop/context/ruby/base/merge.rb'
+# kpse_merge_file: 'c:/data/develop/context/ruby/base/merge.rb'
# module : base/merge
# copyright : PRAGMA Advanced Document Engineering
@@ -1475,8 +1475,8 @@ $predefined['pdftools'] = 'pdftools.rb'
$predefined['mpstools'] = 'mpstools.rb'
$predefined['exatools'] = 'exatools.rb'
$predefined['xmltools'] = 'xmltools.rb'
-$predefined['luatools'] = 'luatools.lua'
-$predefined['mtxtools'] = 'mtxtools.rb'
+# $predefined['luatools'] = 'luatools.lua'
+# $predefined['mtxtools'] = 'mtxtools.rb'
$predefined['newpstopdf'] = 'pstopdf.rb'
$predefined['newtexexec'] = 'texexec.rb'
@@ -1501,8 +1501,8 @@ $makelist = [
'exatools',
'runtools',
'rlxtools',
- 'luatools',
- 'mtxtools',
+ # 'luatools',
+ # 'mtxtools',
#
# no, 'texmfstart'
]
@@ -1537,7 +1537,7 @@ def set_applications(page=1)
$applications['htm'] = $applications['html']
$applications['eps'] = $applications['ps']
- $runners['lua'] = "luatex --luaonly"
+ $runners['lua'] = "texlua"
end
diff --git a/scripts/context/stubs/mswin/luatools.bat b/scripts/context/stubs/mswin/luatools.bat
deleted file mode 100755
index 707657fad..000000000
--- a/scripts/context/stubs/mswin/luatools.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@echo off
-texmfstart luatools.lua %*
diff --git a/scripts/context/stubs/mswin/mtxtools.bat b/scripts/context/stubs/mswin/mtxtools.bat
deleted file mode 100755
index b658116a5..000000000
--- a/scripts/context/stubs/mswin/mtxtools.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@echo off
-texmfstart mtxtools.rb %*
diff --git a/scripts/context/stubs/unix/luatools b/scripts/context/stubs/unix/luatools
deleted file mode 100755
index cb3ec1add..000000000
--- a/scripts/context/stubs/unix/luatools
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-texmfstart luatools.lua "$@"
diff --git a/scripts/context/stubs/unix/mtxtools b/scripts/context/stubs/unix/mtxtools
deleted file mode 100755
index 2922e0b46..000000000
--- a/scripts/context/stubs/unix/mtxtools
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-texmfstart mtxtools.rb "$@"