waf: git_submodule: override uid()

By running waf with option -v, waf was complaining about the update_submodule
tasks having the same identifier. That happened because the default uid()
method depended on the class name, inputs and outputs. Since this type of task
doesn't have input nor output file, we need to override uid() so that it uses
the submodule path for the task identifier.
This commit is contained in:
Gustavo Jose de Sousa 2016-02-11 13:36:30 +00:00 committed by Lucas De Marchi
parent d04b5e735f
commit 7259ac33f0
1 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,15 @@ class update_submodule(Task.Task):
return Task.SKIP_ME return Task.SKIP_ME
def uid(self):
if not hasattr(self, 'uid_'):
m = Utils.md5()
m.update(self.__class__.__name__)
m.update(self.env.get_flat('SUBMODULE_PATH'))
self.uid_ = m.digest()
return self.uid_
def __str__(self): def __str__(self):
return 'Submodule update: %s' % self.submodule return 'Submodule update: %s' % self.submodule