sgmldoc check now works but only if not cached by scons

This commit is contained in:
Radim Kolar 2009-09-10 19:46:50 +02:00
parent 6040ac798a
commit 58cfef2258

View File

@ -7,18 +7,22 @@
from SCons.Script import ARGUMENTS,Touch,Delete
import os
import SCons.Action
def checkForSGMLFMT(check):
"""Returns True if we have working sgmlfmt executable for building documentation."""
check.Message("Checking for working sgmlfmt... ")
Touch('empty')
Delete('empty.html')
oldp=SCons.Action.print_actions
SCons.Action.print_actions = 0
check.env.Execute(Touch('empty'))
check.env.Execute(Delete('empty.html'))
rc,out=check.TryAction("sgmlfmt -d docbook -f html empty")
if os.path.isfile('empty.html'):
rc = 0
else:
rc = 127
Delete(['empty','empty.html'])
check.env.Execute(Delete(['empty','empty.html']))
SCons.Action.print_actions = oldp
if rc == 0:
check.Result(True)
return True