From 1a8e5c881dfddf51916440fedf98fcb2a764c008 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sun, 22 Jan 2017 14:40:36 +0100 Subject: [PATCH] Simplify task un-installation --- waflib/Build.py | 16 ---------------- waflib/Task.py | 5 ++++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/waflib/Build.py b/waflib/Build.py index 23db1df9..f98a51ba 100644 --- a/waflib/Build.py +++ b/waflib/Build.py @@ -1251,22 +1251,6 @@ class UninstallContext(InstallContext): super(UninstallContext, self).__init__(**kw) self.is_install = UNINSTALL - def execute(self): - """ - See :py:func:`waflib.Build.BuildContext.execute`. - """ - # TODO just mark the tasks are already run with hasrun=Task.SKIPPED? - try: - # do not execute any tasks - def runnable_status(self): - return Task.SKIP_ME - setattr(Task.Task, 'runnable_status_back', Task.Task.runnable_status) - setattr(Task.Task, 'runnable_status', runnable_status) - - super(UninstallContext, self).execute() - finally: - setattr(Task.Task, 'runnable_status', Task.Task.runnable_status_back) - class CleanContext(BuildContext): '''cleans the project''' cmd = 'clean' diff --git a/waflib/Task.py b/waflib/Task.py index a62c32b6..58e5fbb1 100644 --- a/waflib/Task.py +++ b/waflib/Task.py @@ -656,6 +656,10 @@ class Task(TaskBase): """ See :py:meth:`waflib.Task.TaskBase.runnable_status` """ + bld = self.generator.bld + if bld.is_install < 0: + return SKIP_ME + for t in self.run_after: if not t.hasrun: return ASK_LATER @@ -670,7 +674,6 @@ class Task(TaskBase): return ASK_LATER # compare the signature to a signature computed previously - bld = self.generator.bld key = self.uid() try: prev_sig = bld.task_sigs[key]