s3-waf: fixed version number handling
authorAndrew Tridgell <tridge@samba.org>
Wed, 8 Dec 2010 03:58:12 +0000 (14:58 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 8 Dec 2010 04:26:06 +0000 (05:26 +0100)
source3/wscript
source3/wscript_build

index da9a9db4b894dc32e70e02aeca3b8a49e5a46088..2bf6fb8f4e0823eec08c789d366913001d44a662 100644 (file)
@@ -11,20 +11,9 @@ from optparse import SUPPRESS_HELP
 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
 import wafsamba, Options
 import build.charset
-import samba_utils
+import samba_utils, samba_version
 import samba3
 
-def load_version(env=None):
-    '''load samba versions either from ./VERSION or git
-    return a version object for detailed breakdown'''
-    import samba_utils, Utils
-    if not env:
-        env = samba_utils.LOAD_ENVIRONMENT()
-
-    version = wafsamba.samba_version_file("./VERSION", "..", env=env)
-    Utils.g_module.VERSION = version.STRING
-    return version
-
 def set_options(opt):
     opt.BUILTIN_DEFAULT('NONE')
     opt.PRIVATE_EXTENSION_DEFAULT('s3')
@@ -68,7 +57,7 @@ def set_options(opt):
 def configure(conf):
     from samba_utils import TO_LIST
 
-    version = load_version(env=conf.env)
+    version = samba_version.load_version(env=conf.env)
 
     conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
     conf.DEFINE('_SAMBA_BUILD_', version.MAJOR, add_to_cflags=True)
index 983b67039c8d8991ac2e560e30b4b6fa684bb4a5..cf5293bd7890b21cab5093bc861762faec095652 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
 from samba_utils import *
+import samba_version
 
 TDB_LIB_SRC = '''lib/util_tdb.c ../lib/util/util_tdb.c
           lib/dbwrap.c lib/dbwrap_tdb.c
@@ -735,6 +736,8 @@ t.env.BUILDDIR = bld.path.abspath()
 
 bld.SETUP_BUILD_GROUPS()
 
+samba_version.load_version(bld.env)
+
 bld.SAMBA_MKVERSION('include/version.h')
 
 bld.RECURSE('../lib/replace')