From 4bd17ab90c276b5529f33ac5e3f64ee4ade45959 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Fri, 22 Jul 2016 20:36:05 -0300 Subject: [PATCH] waf: git_submodule: allow warning about skipped submodules updates Provide a function to register a post build routine to do the warnings. Do that way so that the user can chose when to add the callback to the build (i.e. allow the user to assert a desired order for the post build callbacks to be called). --- Tools/ardupilotwaf/git_submodule.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/git_submodule.py b/Tools/ardupilotwaf/git_submodule.py index f89d89c73b..579e600ebb 100644 --- a/Tools/ardupilotwaf/git_submodule.py +++ b/Tools/ardupilotwaf/git_submodule.py @@ -32,7 +32,7 @@ post_mode should be set to POST_LAZY. Example:: ... """ -from waflib import Context, Task, Utils +from waflib import Context, Logs, Task, Utils from waflib.Configure import conf from waflib.TaskGen import before_method, feature, taskgen_method @@ -146,6 +146,16 @@ def git_submodule(bld, git_submodule, **kw): return bld(**kw) +def _post_fun(bld): + Logs.info('') + for name, t in _submodules_tasks.items(): + if not t.non_fast_forward: + continue + Logs.warn("Submodule %s not updated: non-fastforward" % name) + +@conf +def git_submodule_post_fun(bld): + bld.add_post_fun(_post_fun) def _git_head_hash(ctx, path, short=False): cmd = [ctx.env.get_flat('GIT'), 'rev-parse']