improve hhc workaround
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6881 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
fb2accece2
commit
fed4b288f1
1 changed files with 11 additions and 7 deletions
|
@ -160,18 +160,22 @@ env.Append(BUILDERS = {'Halibut' : docs_builder})
|
||||||
|
|
||||||
# fix hhc.exe reverse return value - UGLY
|
# fix hhc.exe reverse return value - UGLY
|
||||||
old_spawn = env['SPAWN']
|
old_spawn = env['SPAWN']
|
||||||
def new_spawn(*args, **kw):
|
def env_trimming_spawn(*args, **kw):
|
||||||
if 'hhc' in args[3]:
|
# hhc.exe crashes and produces corrupt CHM files with big environment variables
|
||||||
if len(args) == 5:
|
# removing os env doesn't seem to break anything else and it's local to this doc building scons env
|
||||||
args = (args[0], args[1], args[2], args[3], {'PATH': args[4]['PATH']})
|
if len(args) == 5:
|
||||||
else:
|
# env is passed arg (old scons versions maybe?)
|
||||||
kw['env'] = {}
|
args = (args[0], args[1], args[2], args[3], {})
|
||||||
|
else:
|
||||||
|
# env is passed as kwargs
|
||||||
|
kw['env'] = {}
|
||||||
result = old_spawn(*args, **kw)
|
result = old_spawn(*args, **kw)
|
||||||
|
# hhc returns 1 when it's successful, because why not...
|
||||||
for p in args[3]:
|
for p in args[3]:
|
||||||
if 'hhc.exe' in p.lower():
|
if 'hhc.exe' in p.lower():
|
||||||
return not result
|
return not result
|
||||||
return result
|
return result
|
||||||
env['SPAWN'] = new_spawn
|
env['SPAWN'] = env_trimming_spawn
|
||||||
|
|
||||||
# BUILD!
|
# BUILD!
|
||||||
docs = env.Halibut(env['NSISDOCTARGET'], ['$NSISDOCCONFIG'] + buts)
|
docs = env.Halibut(env['NSISDOCTARGET'], ['$NSISDOCCONFIG'] + buts)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue