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)
committerJule Anger <janger@samba.org>
Mon, 23 Oct 2023 08:39:12 +0000 (08:39 +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>
(cherry picked from commit e2ace2d613701f3d4a7c7c202f68d2f193c0a64a)

Makefile
wscript

index 7f5960d5191c154e0290a2c07f8c33f9d8f7f8e0..dbb9fcdf1c3d0d5d150b51b0e5528cecd16bd46f 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 08995fbe4ec190f9b3f986f066d003c2e1f98477..b87b043e12bd9f8c33fd35b0f6ca57b9ad32c3df 100644 (file)
--- a/wscript
+++ b/wscript
@@ -542,6 +542,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