build: Add 'make printversion' to provide version string
authorChristof Schmitt <christof.schmitt@us.ibm.com>
Thu, 12 Sep 2013 23:11:34 +0000 (16:11 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 17 Oct 2023 03:19:38 +0000 (03:19 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15497

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Makefile
wscript

index 09700af32c2cdd6a0ccc17baad909f8e6f6f4293..b037c3983911a6ce5372a6c14bfc625af977e844 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -67,6 +67,10 @@ distcheck:
        touch .tmplock
        WAFLOCK=.tmplock $(WAF) distcheck
 
+printversion:
+       touch .tmplock
+       WAFLOCK=.tmplock $(WAF) printversion
+
 clean:
        $(WAF) clean
 
diff --git a/wscript b/wscript
index 1eaece558f7262568bd7047b73d1634c92ba9a48..f144d9a421c9f0e127aed5b40a0e7f95d6eb16b9 100644 (file)
--- a/wscript
+++ b/wscript
@@ -516,6 +516,11 @@ def distcheck():
     '''test that distribution tarball builds and installs'''
     samba_version.load_version(env=None)
 
+def printversion(ctx):
+    '''print version'''
+    ver = samba_version.load_version(env=None)
+    print('Samba Version: ' + ver.STRING_WITH_NICKNAME)
+
 def wildcard_cmd(cmd):
     '''called on a unknown command'''
     from samba_wildcard import run_named_build_task