From a84e982bebbd1c21eba70f2d4873a4a1f3b0f58e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 28 May 2015 16:17:15 +0200 Subject: [PATCH] ctdb-build: only use ctdb/packaging/mkversion.sh for the standalone build. This avoids rebuilding ctdb after each commit, instead we're using SAMBA_VERSION_STRING, which may contain "4.3.0pre1-DEVELOPERBUILD", instead of "4.3.0pre1.GIT.4ccdd39" for the non-install build. Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Mon Jun 8 15:51:46 CEST 2015 on sn-devel-104 --- ctdb/wscript | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/ctdb/wscript b/ctdb/wscript index 2c9c8b153d0..b5c6087661e 100755 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -225,25 +225,29 @@ def build(bld): # enable building of public headers in the build tree bld.env.build_public_headers = 'include/public' - if bld.env.standalone_ctdb: - ctdb_mkversion = '../packaging/mkversion.sh' - else: - ctdb_mkversion = '../ctdb/packaging/mkversion.sh' - t = bld.SAMBA_GENERATOR('ctdb-version-header', - target='include/ctdb_version.h', - rule='%s ${TGT} %s' % (ctdb_mkversion, VERSION), - dep_vars=['VERSION']) - t.env.VERSION = VERSION + version_h = samba_utils.os_path_relpath(os.path.join(Options.launch_dir, + "version.h"), + bld.curdir) if bld.env.standalone_ctdb: - version_h = samba_utils.os_path_relpath(os.path.join(Options.launch_dir, - "version.h"), - bld.curdir) + ctdb_mkversion = '../packaging/mkversion.sh' + t = bld.SAMBA_GENERATOR('ctdb-version-header', + target='include/ctdb_version.h', + rule='%s ${TGT} %s' % (ctdb_mkversion, VERSION), + dep_vars=['VERSION']) + t.env.VERSION = VERSION + t = bld.SAMBA_GENERATOR('ctdb-samba-version-header', target=version_h, rule='printf "#include \\"ctdb_version.h\\" \\n#define SAMBA_VERSION_STRING CTDB_VERSION_STRING\\n" > ${TGT}', dep_vars=['VERSION']) t.env.VERSION = VERSION + else: + t = bld.SAMBA_GENERATOR('ctdb-samba-version-header', + target='include/ctdb_version.h', + rule='printf "#include \\"%s\\" \\n#define CTDB_VERSION_STRING SAMBA_VERSION_STRING\\n" > ${TGT}' % version_h, + dep_vars=['VERSION']) + t.env.VERSION = VERSION bld.RECURSE('lib/replace') if bld.CHECK_FOR_THIRD_PARTY():