mirror of https://gitlab.com/ita1024/waf.git
Fix chmod with tuple rules #1884
This commit is contained in:
parent
dbe1a4ad78
commit
2d6487883c
|
@ -1,5 +1,7 @@
|
||||||
#! /usr/bin/env python3
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
from waflib import Utils
|
||||||
|
|
||||||
top = '.'
|
top = '.'
|
||||||
out = 'bin'
|
out = 'bin'
|
||||||
|
|
||||||
|
@ -19,6 +21,7 @@ def build(bld):
|
||||||
t = bld(rule='touch ${TGT}', target='bbb', source='aaa')
|
t = bld(rule='touch ${TGT}', target='bbb', source='aaa')
|
||||||
t = bld(rule='touch ${TGT}', target='ccc', source='bbb')
|
t = bld(rule='touch ${TGT}', target='ccc', source='bbb')
|
||||||
t = bld(rule='touch ${TGT}', target='ddd', source='ccc')
|
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')
|
t.create_task('foo')
|
||||||
|
|
||||||
#print( 'path from srcnode', bld.path.find_or_declare('aaa').path_from(bld.bldnode) )
|
#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):
|
def chmod_fun(tsk):
|
||||||
for x in tsk.outputs:
|
for x in tsk.outputs:
|
||||||
os.chmod(x.abspath(), self.chmod)
|
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,
|
cls = Task.task_factory(name, rule,
|
||||||
getattr(self, 'vars', []),
|
getattr(self, 'vars', []),
|
||||||
|
|
Loading…
Reference in New Issue