summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/context/ruby/base/switch.rb19
-rw-r--r--scripts/context/ruby/base/tex.rb6
-rw-r--r--scripts/context/ruby/texexec.rb33
-rw-r--r--scripts/context/ruby/texmfstart.rb29
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/enco-pfr.mkiv18
-rw-r--r--tex/context/interface/keys-cz.xml2
-rw-r--r--tex/context/interface/keys-de.xml2
-rw-r--r--tex/context/interface/keys-en.xml2
-rw-r--r--tex/context/interface/keys-fr.xml2
-rw-r--r--tex/context/interface/keys-it.xml2
-rw-r--r--tex/context/interface/keys-nl.xml2
-rw-r--r--tex/context/interface/keys-ro.xml2
14 files changed, 72 insertions, 51 deletions
diff --git a/scripts/context/ruby/base/switch.rb b/scripts/context/ruby/base/switch.rb
index 5187a795f..19eced424 100644
--- a/scripts/context/ruby/base/switch.rb
+++ b/scripts/context/ruby/base/switch.rb
@@ -86,7 +86,7 @@ module CommandBase
def initialize(commandline,logger,banner)
@commandline, @logger, @banner = commandline, logger, banner
- @forcenewline, @versiondone = false, false
+ @forcenewline, @versiondone, @error = false, false, false
version if @commandline.option('version')
end
@@ -117,6 +117,23 @@ module CommandBase
initlogger ; @logger.report(str)
end
+ def seterror
+ @error = true
+ end
+
+ def error?
+ return @error
+ end
+
+ def exit
+ if @error then Kernel.exit(1) else Kernel.exit(0) end
+ end
+
+ def execute(str=nil)
+ send(str || action || 'main')
+ exit
+ end
+
def debug(*str)
initlogger ; @logger.debug(str)
end
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 69d5fd750..5674157b5 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -634,6 +634,7 @@ class TEX
# generate tex formats
unless texformats || mpsformats then
report('provide valid format (name.tex, name.mp, ...) or format id (metafun, en, nl, ...)')
+ setvariable('error','no format specified')
end
if texformats && texengine then
report("using tex engine #{texengine}")
@@ -677,11 +678,14 @@ class TEX
mpsformats.each do |mpsformat|
report("generating mps format #{mpsformat}")
progname = validprogname([getvariable('progname'),mpsformat,mpsengine])
- runcommand([quoted(mpsengine),prognameflag(progname),iniflag,tcxflag,runoptions(mpsengine),mpsformat,mpsmakeextras(mpsformat)])
+ if not runcommand([quoted(mpsengine),prognameflag(progname),iniflag,tcxflag,runoptions(mpsengine),mpsformat,mpsmakeextras(mpsformat)]) then
+ setvariable('error','no format made')
+ end
end
else
report("unable to make format due to lack of permissions")
mpsformatpath = ''
+ setvariable('error','file permission problem')
end
else
mpsformatpath = ''
diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb
index 3d504ac9e..992766c05 100644
--- a/scripts/context/ruby/texexec.rb
+++ b/scripts/context/ruby/texexec.rb
@@ -36,6 +36,7 @@ class Commands
end
job.makeformats
job.inspect && Kpse.inspect if @commandline.option('verbose')
+ seterror if job.error?
end
end
@@ -60,7 +61,7 @@ class Commands
prepare(job)
job.processtex
job.inspect && Kpse.inspect if @commandline.option('verbose')
- exit 1 if job.error?
+ seterror if job.error?
end
end
@@ -70,7 +71,7 @@ class Commands
prepare(job)
job.processmptex
job.inspect && Kpse.inspect if @commandline.option('verbose')
- exit 1 if job.error?
+ seterror if job.error?
end
end
@@ -80,7 +81,7 @@ class Commands
prepare(job)
job.processmpxtex
job.inspect && Kpse.inspect if @commandline.option('verbose')
- exit 1 if job.error?
+ seterror if job.error?
end
end
@@ -90,7 +91,7 @@ class Commands
prepare(job)
job.processmpgraphic
job.inspect && Kpse.inspect if @commandline.option('verbose')
- exit 1 if job.error?
+ seterror if job.error?
end
end
@@ -100,7 +101,7 @@ class Commands
prepare(job)
job.processmpstatic
job.inspect && Kpse.inspect if @commandline.option('verbose')
- exit 1 if job.error?
+ seterror if job.error?
end
end
@@ -216,11 +217,11 @@ class Commands
fnames.each do |ffname|
if msuffixes.include?(File.splitname(ffname)[1]) && FileTest.file?(ffname) then
if mod = File.open(job.tempfilename('tex'),'w') then
-if File.suffix(ffname) =~ /^(mkii|mkiv)$/o then
- markfile = $1
-else
- markfile = nil
-end
+ if File.suffix(ffname) =~ /^(mkii|mkiv)$/o then
+ markfile = $1
+ else
+ markfile = nil
+ end
Kpse.runscript('ctxtools',ffname,'--document')
if ted = File.silentopen(File.suffixed(ffname,'ted')) then
firstline = ted.gets
@@ -244,11 +245,11 @@ end
job.setvariable('simplerun',true)
# job.setvariable('nooptionfile',true)
job.setvariable('files',[job.tempfilename])
-result = File.unsuffixed(File.basename(ffname))
-if markfile then
- result = result+'-'+markfile
-end
-job.setvariable('result',result)
+ result = File.unsuffixed(File.basename(ffname))
+ if markfile then
+ result = result+'-'+markfile
+ end
+ job.setvariable('result',result)
job.processtex
# ["dvi", "pdf","ps"].each do |s|
# File.silentrename(job.tempfilename(s),File.suffixed(ffname,s));
@@ -767,4 +768,4 @@ commandline.registerflag('verbose')
commandline.expand
-Commands.new(commandline,logger,banner).send(commandline.action || 'main')
+Commands.new(commandline,logger,banner).execute(commandline.action || 'main') # or just execute()
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index 6dd79dc1e..9a19995a1 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -2490,27 +2490,35 @@ def execute(arguments)
if $selfmerge then
output("ruby libraries are cleaned up") if SelfMerge::cleanup
output("ruby libraries are merged") if SelfMerge::merge
+ return true
elsif $selfcleanup then
output("ruby libraries are cleaned up") if SelfMerge::cleanup
+ return true
elsif $serve then
if ENV['KPSEMETHOD'] && ENV['KPSEPORT'] then
# # kpse_merge_done: require 'base/kpseremote'
begin
KpseRemote::start_server
rescue
+ return false
+ else
+ return true
end
else
usage
puts("")
puts("message : set 'KPSEMETHOD' and 'KPSEPORT' variables")
+ return false
end
elsif $help || ! $filename || $filename.empty? then
usage
loadtree($tree)
loadenvironment($environment)
show_environment()
+ return true
elsif $batch && $filename && ! $filename.empty? then
# todo, take commands from file and avoid multiple starts and checks
+ return false
else
report("texmfstart version #{$version}")
loadtree($tree)
@@ -2531,33 +2539,42 @@ def execute(arguments)
make(filename,$mswindows,!$mswindows,$remove)
end
end
+ return true # guess
elsif $browser && $filename =~ /^http\:\/\// then
- launch($filename)
+ return launch($filename)
else
begin
process do
if $direct || $filename =~ /^bin\:/ then
- direct($filename)
+ return direct($filename)
elsif $edit && ! $editor.empty? then
- edit($filename)
+ return edit($filename)
else # script: or no prefix
command = find(shortpathname($filename),$program)
if command then
register("THREAD",File.dirname(File.expand_path(command)))
- run(command)
+ return run(command)
else
report('unable to locate program')
+ return false
end
end
end
rescue
report('fatal error in starting process')
+ return false
end
end
end
end
-execute(ARGV)
+if execute(ARGV) then
+ report("\nexecution was successful") if $verbose
+ exit(1)
+else
+ report("\nexecution failed") if $verbose
+ exit(0)
+end
-exit (if ($?.to_i rescue 0) > 0 then 1 else 0 end)
+# exit (if ($?.to_i rescue 0) > 0 then 1 else 0 end)
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index c473e63b3..407d56daf 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -13,7 +13,7 @@
% it's about time to clean up this file ...
-\newcontextversion{2007.01.09 20:04}
+\newcontextversion{2007.01.10 11:18}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 869287953..051b0f72d 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -42,7 +42,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2007.01.09 20:04}
+\edef\contextversion{2007.01.10 11:18}
%D For those who want to use this:
diff --git a/tex/context/base/enco-pfr.mkiv b/tex/context/base/enco-pfr.mkiv
deleted file mode 100644
index 0686e5327..000000000
--- a/tex/context/base/enco-pfr.mkiv
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=enco-pfr,
-%D version=2000.12.10, % adapted 2005.08.14 to more delayed loading
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=PDF Font Resource Inclusion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\appendtoks
- \ctxlua{characters.setpdfunicodes()}% pdftounicode mappings can only be done runtime
-\to \everystarttext
-
-\endinput
diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml
index eefb6e406..da831a1ea 100644
--- a/tex/context/interface/keys-cz.xml
+++ b/tex/context/interface/keys-cz.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="jedna"/>
diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml
index 8a0871408..bfe5e3947 100644
--- a/tex/context/interface/keys-de.xml
+++ b/tex/context/interface/keys-de.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="eins"/>
diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml
index 6044590b9..7ae1d3075 100644
--- a/tex/context/interface/keys-en.xml
+++ b/tex/context/interface/keys-en.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="one"/>
diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml
index 3babc1bec..0035f57dd 100644
--- a/tex/context/interface/keys-fr.xml
+++ b/tex/context/interface/keys-fr.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="un"/>
diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml
index 7c5520546..e0856211c 100644
--- a/tex/context/interface/keys-it.xml
+++ b/tex/context/interface/keys-it.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="uno"/>
diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml
index 4796b7da5..dcc3e7b06 100644
--- a/tex/context/interface/keys-nl.xml
+++ b/tex/context/interface/keys-nl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="een"/>
diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml
index 13811d91a..b0a437768 100644
--- a/tex/context/interface/keys-ro.xml
+++ b/tex/context/interface/keys-ro.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2007.01.09 20:04">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2007.01.10 11:18">
<cd:variables>
<cd:variable name="one" value="unu"/>