mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 09:57:15 +01:00
Fix chmod with tuple rules #1884
This commit is contained in:
parent
c78d53a7a2
commit
3c22fd412e
@ -1,5 +1,7 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
from waflib import Utils
|
||||
|
||||
top = '.'
|
||||
out = 'bin'
|
||||
|
||||
@ -19,6 +21,7 @@ def build(bld):
|
||||
t = bld(rule='touch ${TGT}', target='bbb', source='aaa')
|
||||
t = bld(rule='touch ${TGT}', target='ccc', source='bbb')
|
||||
t = bld(rule='touch ${TGT}', target='ddd', source='ccc')
|
||||
t = bld(rule=('touch ${TGT}', 'touch ${TGT}'), target='eee', source='ddd', chmod=Utils.O755)
|
||||
t.create_task('foo')
|
||||
|
||||
#print( 'path from srcnode', bld.path.find_or_declare('aaa').path_from(bld.bldnode) )
|
||||
|
@ -571,7 +571,12 @@ def process_rule(self):
|
||||
def chmod_fun(tsk):
|
||||
for x in tsk.outputs:
|
||||
os.chmod(x.abspath(), self.chmod)
|
||||
rule = (self.rule, chmod_fun)
|
||||
if isinstance(self.rule, tuple):
|
||||
rule = list(self.rule)
|
||||
rule.append(chmod_fun)
|
||||
rule = tuple(rule)
|
||||
else:
|
||||
rule = (rule, chmod_fun)
|
||||
|
||||
cls = Task.task_factory(name, rule,
|
||||
getattr(self, 'vars', []),
|
||||
|
Loading…
Reference in New Issue
Block a user