diff options
| author | Robert Managan <managan1@llnl.gov> | 2008-09-04 22:30:55 (GMT) |
|---|---|---|
| committer | Robert Managan <managan1@llnl.gov> | 2008-09-04 22:30:55 (GMT) |
| commit | 6fbb44b7d5934ee36244049bfea68d44de968a86 (patch) | |
| tree | cd48d228098e677f5d25ebea2cd5b6cc9a2cc7ed /src | |
| parent | 6a4d9df86030463c35d40e1a314721eb546fb84e (diff) | |
| download | SCons-6fbb44b7d5934ee36244049bfea68d44de968a86.zip SCons-6fbb44b7d5934ee36244049bfea68d44de968a86.tar.gz SCons-6fbb44b7d5934ee36244049bfea68d44de968a86.tar.bz2 | |
Pass the results of the InternalLaTeXAuxAction back up the call chain
in teh various tex builders. This allows the user to interrupt the build
which was not working before.
It also allows configuration tests to work since now they can tell if
there was failure in a test.
The result from the internal MakeIndexAction and BibtexAction are
checked as well and control returned if there was an error in one
of those. This is to avoid repeatedly running commands until we
hit the retry limit.
I added no test for this simce I am unsure how to test for user
interrupts. Also unclear how to test for how many times the internal
actions were run during a test to see if it returns on teh first error!
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/SCons/Tool/latex.py | 3 | ||||
| -rw-r--r-- | src/engine/SCons/Tool/pdflatex.py | 3 | ||||
| -rw-r--r-- | src/engine/SCons/Tool/pdftex.py | 9 | ||||
| -rw-r--r-- | src/engine/SCons/Tool/tex.py | 30 |
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 |
