mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-25 11:19:52 +01:00
Simplify task un-installation
This commit is contained in:
parent
57b406aaff
commit
1a8e5c881d
@ -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'
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user