2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-26 11:51:20 +01:00

Extract Build.inst.run_now

This commit is contained in:
Thomas Nagy 2016-05-06 09:57:01 +02:00
parent 20b62a4eea
commit 9991004343
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64

View File

@ -933,11 +933,7 @@ def add_install_tasks(self):
tsk.set_outputs(outputs)
if not getattr(self, 'postpone', True):
status = self.install_task.runnable_status()
if status not in (Task.RUN_ME, Task.SKIP_ME):
raise Errors.WafError('Could not process %r (not ready %r)' % (self.install_task, status))
self.install_task.run()
self.install_task.hasrun = Task.SUCCESS
tsk.run_now()
class inst(Task.Task):
color = 'CYAN'
@ -1001,6 +997,14 @@ class inst(Task.Task):
for x, y in zip(self.inputs, self.outputs):
fun(x.abspath(), y.abspath(), x.path_from(launch_node))
def run_now(self):
"""Try executing the installation task right now"""
status = self.runnable_status()
if status not in (Task.RUN_ME, Task.SKIP_ME):
raise Errors.TaskNotReady('Could not process %r: status %r' % (self, status))
self.run()
self.hasrun = Task.SUCCESS
def do_install(self, src, tgt, lbl, **kw):
"""
Copy a file from src to tgt with given file permissions. The actual copy is not performed