Update waflib/extras/stale.py

This commit is contained in:
Thomas Nagy 2016-05-29 14:11:05 +02:00
parent 02a8361149
commit 6665a6ebdd
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 6 additions and 5 deletions

View File

@ -13,6 +13,8 @@ a full 'waf clean'
Of course, it will only work if there are no dynamically generated
nodes/tasks, in which case the method will have to be modified
to exclude some folders for example.
Make sure to set bld.post_mode = waflib.Build.POST_AT_ONCE
"""
from waflib import Logs, Build
@ -73,21 +75,20 @@ def refill_task_list(self):
self.stale_done = True
# this does not work in partial builds
if hasattr(bld, 'options') and bld.options.targets and bld.options.targets != '*':
if bld.targets != '*':
return iit
# this does not work in dynamic builds
if not hasattr(bld, 'post_mode') or bld.post_mode == Build.POST_LAZY:
if getattr(bld, 'post_mode') == Build.POST_AT_ONCE:
return iit
# obtain the nodes to use during the build
nodes = []
for i in range(len(bld.groups)):
tasks = bld.get_tasks_group(i)
for tasks in bld.groups:
for x in tasks:
try:
nodes.extend(x.outputs)
except:
except AttributeError:
pass
stale_rec(bld.bldnode, nodes)