diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2015-05-18 20:00:30 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-05-19 19:28:19 +0200 |
commit | 5e0821201cc6b5ffc15b1b795ee85dabd3e9220c (patch) | |
tree | 15928c79ef6a5f6477dfab6c1517ea6cbf4acfdd /wscript | |
parent | 5d672b9a530e79aff2a7791df82893bcd50d6233 (diff) | |
download | samba-5e0821201cc6b5ffc15b1b795ee85dabd3e9220c.tar.gz |
Make waf fail if submodules are out of date.
Instead, suggest the user run 'git submodule update'.
This should prevent users from accidentally building Samba against
outdated or too new versions of the bundled third party libraries
after switching branches.
I've opted to make this an error rather than actually
running 'git submodule update' directly, as the latter could
cause unpredictable behaviour. If we find that manually updating
submodules is too cumbersome, we can always change this. The normal mode
of operation for developers should not involve any submodules at all,
but system versions of these libraries.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -8,7 +8,7 @@ VERSION=None import sys, os, tempfile sys.path.insert(0, srcdir+"/buildtools/wafsamba") -import wafsamba, Options, samba_dist, Scripting, Utils, samba_version +import wafsamba, Options, samba_dist, samba_git, Scripting, Utils, samba_version samba_dist.DIST_DIRS('.') @@ -225,6 +225,7 @@ def ctags(ctx): if os.WEXITSTATUS(status): raise Utils.WafError('ctags failed') + # putting this here enabled build in the list # of commands in --help def build(bld): @@ -320,6 +321,7 @@ def wildcard_cmd(cmd): def main(): from samba_wildcard import wildcard_main + wildcard_main(wildcard_cmd) Scripting.main = main @@ -327,3 +329,10 @@ def reconfigure(ctx): '''reconfigure if config scripts have changed''' import samba_utils samba_utils.reconfigure(ctx) + + +if os.path.isdir(os.path.join(srcdir, ".git")): + # Check if there are submodules that are checked out but out of date. + for submodule, status in samba_git.read_submodule_status(srcdir): + if status == "out-of-date": + raise Utils.WafError("some submodules are out of date. Please run 'git submodule update'") |