2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 18:07:12 +01:00

Append tex configuration outputs to config.log

This commit is contained in:
Thomas Nagy 2016-11-04 06:10:17 +01:00
parent 86e9c0527c
commit 076d9202ba
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA

View File

@ -111,7 +111,9 @@ class tex(Task.Task):
:return: the return code :return: the return code
:rtype: int :rtype: int
""" """
kw['stdout'] = kw['stderr'] = None if self.env.PROMPT_LATEX:
# capture the outputs in configuration tests
kw['stdout'] = kw['stderr'] = None
return super(tex, self).exec_command(cmd, **kw) return super(tex, self).exec_command(cmd, **kw)
def scan_aux(self, node): def scan_aux(self, node):
@ -227,6 +229,13 @@ class tex(Task.Task):
if retcode != 0: if retcode != 0:
raise Errors.WafError('%r command exit status %r' % (msg, retcode)) raise Errors.WafError('%r command exit status %r' % (msg, retcode))
def info(self, *k, **kw):
try:
info = self.generator.bld.conf.logger.info
except AttributeError:
info = Logs.info
info(*k, **kw)
def bibfile(self): def bibfile(self):
""" """
Parses *.aux* files to find bibfiles to process. Parses *.aux* files to find bibfiles to process.
@ -240,7 +249,7 @@ class tex(Task.Task):
continue continue
if g_bibtex_re.findall(ct): if g_bibtex_re.findall(ct):
Logs.info('calling bibtex') self.info('calling bibtex')
self.env.env = {} self.env.env = {}
self.env.env.update(os.environ) self.env.env.update(os.environ)
@ -268,7 +277,7 @@ class tex(Task.Task):
if bibunits: if bibunits:
fn = ['bu' + str(i) for i in range(1, len(bibunits) + 1)] fn = ['bu' + str(i) for i in range(1, len(bibunits) + 1)]
if fn: if fn:
Logs.info('calling bibtex on bibunits') self.info('calling bibtex on bibunits')
for f in fn: for f in fn:
self.env.env = {'BIBINPUTS': self.texinputs(), 'BSTINPUTS': self.texinputs()} self.env.env = {'BIBINPUTS': self.texinputs(), 'BSTINPUTS': self.texinputs()}
@ -285,9 +294,9 @@ class tex(Task.Task):
idx_path = self.idx_node.abspath() idx_path = self.idx_node.abspath()
os.stat(idx_path) os.stat(idx_path)
except OSError: except OSError:
Logs.info('index file %s absent, not calling makeindex', idx_path) self.info('index file %s absent, not calling makeindex', idx_path)
else: else:
Logs.info('calling makeindex') self.info('calling makeindex')
self.env.SRCFILE = self.idx_node.name self.env.SRCFILE = self.idx_node.name
self.env.env = {} self.env.env = {}
@ -349,7 +358,7 @@ class tex(Task.Task):
# important, set the cwd for everybody # important, set the cwd for everybody
self.cwd = self.inputs[0].parent.get_bld() self.cwd = self.inputs[0].parent.get_bld()
Logs.info('first pass on %s', self.__class__.__name__) self.info('first pass on %s', self.__class__.__name__)
# Hash .aux files before even calling the LaTeX compiler # Hash .aux files before even calling the LaTeX compiler
cur_hash = self.hash_aux_nodes() cur_hash = self.hash_aux_nodes()
@ -375,7 +384,7 @@ class tex(Task.Task):
break break
# run the command # run the command
Logs.info('calling %s', self.__class__.__name__) self.info('calling %s', self.__class__.__name__)
self.call_latex() self.call_latex()
def hash_aux_nodes(self): def hash_aux_nodes(self):
@ -446,7 +455,13 @@ def apply_tex(self):
outs = Utils.to_list(getattr(self, 'outs', [])) outs = Utils.to_list(getattr(self, 'outs', []))
# prompt for incomplete files (else the batchmode is used) # prompt for incomplete files (else the batchmode is used)
self.env.PROMPT_LATEX = getattr(self, 'prompt', 1) try:
self.generator.bld.conf
except AttributeError:
default_prompt = False
else:
default_prompt = True
self.env.PROMPT_LATEX = getattr(self, 'prompt', default_prompt)
deps_lst = [] deps_lst = []