summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Tool/latex.py3
-rw-r--r--src/engine/SCons/Tool/pdflatex.py3
-rw-r--r--src/engine/SCons/Tool/pdftex.py9
-rw-r--r--src/engine/SCons/Tool/tex.py30
4 files changed, 30 insertions, 15 deletions
diff --git a/src/engine/SCons/Tool/latex.py b/src/engine/SCons/Tool/latex.py
index 8258829..69b544a 100644
--- a/src/engine/SCons/Tool/latex.py
+++ b/src/engine/SCons/Tool/latex.py
@@ -43,7 +43,8 @@ import SCons.Tool.tex
LaTeXAction = None
def LaTeXAuxFunction(target = None, source= None, env=None):
- SCons.Tool.tex.InternalLaTeXAuxAction( LaTeXAction, target, source, env )
+ result = SCons.Tool.tex.InternalLaTeXAuxAction( LaTeXAction, target, source, env )
+ return result
LaTeXAuxAction = SCons.Action.Action(LaTeXAuxFunction,
strfunction=SCons.Tool.tex.TeXLaTeXStrFunction)
diff --git a/src/engine/SCons/Tool/pdflatex.py b/src/engine/SCons/Tool/pdflatex.py
index b8a7736..91868ef 100644
--- a/src/engine/SCons/Tool/pdflatex.py
+++ b/src/engine/SCons/Tool/pdflatex.py
@@ -41,7 +41,8 @@ import SCons.Tool.tex
PDFLaTeXAction = None
def PDFLaTeXAuxFunction(target = None, source= None, env=None):
- SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
+ result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
+ return result
PDFLaTeXAuxAction = None
diff --git a/src/engine/SCons/Tool/pdftex.py b/src/engine/SCons/Tool/pdftex.py
index 7bd57b0..75c6bc9 100644
--- a/src/engine/SCons/Tool/pdftex.py
+++ b/src/engine/SCons/Tool/pdftex.py
@@ -44,17 +44,18 @@ PDFTeXAction = None
PDFLaTeXAction = None
def PDFLaTeXAuxAction(target = None, source= None, env=None):
- SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
+ result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
+ return result
def PDFTeXLaTeXFunction(target = None, source= None, env=None):
"""A builder for TeX and LaTeX that scans the source file to
decide the "flavor" of the source and then executes the appropriate
program."""
if SCons.Tool.tex.is_LaTeX(source):
- PDFLaTeXAuxAction(target,source,env)
+ result = PDFLaTeXAuxAction(target,source,env)
else:
- PDFTeXAction(target,source,env)
- return 0
+ result = PDFTeXAction(target,source,env)
+ return result
PDFTeXLaTeXAction = None
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py
index 29dc81d..0c1ed3d 100644
--- a/src/engine/SCons/Tool/tex.py
+++ b/src/engine/SCons/Tool/tex.py
@@ -122,7 +122,9 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
tocContents = open(tocfilename, "rb").read()
# Run LaTeX once to generate a new aux file and log file.
- XXXLaTeXAction(target, source, env)
+ result = XXXLaTeXAction(target, source, env)
+ if result != 0:
+ return result
# Decide if various things need to be run, or run again. We check
# for the existence of files before opening them--even ones like the
@@ -143,7 +145,9 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
content = open(target_aux, "rb").read()
if string.find(content, "bibdata") != -1:
bibfile = env.fs.File(targetbase)
- BibTeXAction(bibfile, bibfile, env)
+ result = BibTeXAction(bibfile, bibfile, env)
+ if result != 0:
+ return result
break
must_rerun_latex = 0
@@ -159,11 +163,15 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
if os.path.exists(idxfilename) and idxContents != open(idxfilename, "rb").read():
# We must run makeindex
idxfile = env.fs.File(targetbase)
- MakeIndexAction(idxfile, idxfile, env)
+ result = MakeIndexAction(idxfile, idxfile, env)
+ if result != 0:
+ return result
must_rerun_latex = 1
if must_rerun_latex == 1:
- XXXLaTeXAction(target, source, env)
+ result = XXXLaTeXAction(target, source, env)
+ if result != 0:
+ return result
# Now decide if latex needs to be run yet again to resolve warnings.
logfilename = targetbase + '.log'
@@ -175,7 +183,9 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
not rerun_citations_re.search(content) and \
not undefined_references_re.search(content):
break
- XXXLaTeXAction(target, source, env)
+ result = XXXLaTeXAction(target, source, env)
+ if result != 0:
+ return result
env['ENV']['TEXINPUTS'] = texinputs_save
env['ENV']['BIBINPUTS'] = bibinputs_save
@@ -185,10 +195,11 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None
# later on Mac OSX so leave it,
# env['ENV']['TEXPICTS'] = texpicts_save
- return 0
+ return result
def LaTeXAuxAction(target = None, source= None, env=None):
- InternalLaTeXAuxAction( LaTeXAction, target, source, env )
+ result = InternalLaTeXAuxAction( LaTeXAction, target, source, env )
+ return result
LaTeX_re = re.compile("\\\\document(style|class)")
@@ -205,9 +216,10 @@ def TeXLaTeXFunction(target = None, source= None, env=None):
decide the "flavor" of the source and then executes the appropriate
program."""
if is_LaTeX(source):
- LaTeXAuxAction(target,source,env)
+ result = LaTeXAuxAction(target,source,env)
else:
- TeXAction(target,source,env)
+ result = TeXAction(target,source,env)
+ return result
def TeXLaTeXStrFunction(target = None, source= None, env=None):
"""A strfunction for TeX and LaTeX that scans the source file to