From 9991004343d72ac3a4cf06ff449950f2ed639903 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Fri, 6 May 2016 09:57:01 +0200 Subject: [PATCH] Extract Build.inst.run_now --- waflib/Build.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/waflib/Build.py b/waflib/Build.py index 3c860872..84d1bcd9 100644 --- a/waflib/Build.py +++ b/waflib/Build.py @@ -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