From d1094c61b213e9897b6191965d07a5c250f0be9b Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 24 Jul 2007 14:36:00 +0200 Subject: stable 2007.07.24 14:36 --- scripts/context/ruby/base/tex.rb | 51 ++++++++++++++++---------------- scripts/context/ruby/base/texutil.rb | 11 ++++--- scripts/context/ruby/ctxtools.rb | 2 +- scripts/context/ruby/texexec.rb | 3 +- scripts/context/ruby/texmfstart.rb | 22 +++++++------- scripts/context/stubs/mswin/luatools.bat | 2 -- scripts/context/stubs/mswin/mtxtools.bat | 2 -- scripts/context/stubs/unix/luatools | 2 -- scripts/context/stubs/unix/mtxtools | 2 -- 9 files changed, 45 insertions(+), 52 deletions(-) delete mode 100755 scripts/context/stubs/mswin/luatools.bat delete mode 100755 scripts/context/stubs/mswin/mtxtools.bat delete mode 100755 scripts/context/stubs/unix/luatools delete mode 100755 scripts/context/stubs/unix/mtxtools (limited to 'scripts') 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 "$@" -- cgit v1.2.3