]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
build: Add --vendor-name --vendor-patch-revision options to ./configure
authorAndrew Bartlett <abartlet@samba.org>
Wed, 29 May 2024 22:50:12 +0000 (10:50 +1200)
committerJule Anger <janger@samba.org>
Wed, 3 Jul 2024 08:48:12 +0000 (08:48 +0000)
These options are for packagers and vendors to set so that when
Samba developers are debugging an issue, we know exactly which
package is in use, and so have an idea if any patches have been
applied.

This is included in the string that a Samba backtrace gives,
as part of the PANIC message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15654
REF: https://lists.samba.org/archive/samba-technical/2024-May/138992.html

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 651fb94c374c7f84405d960a9e0a0fd7fcb285dd)

buildtools/wafsamba/samba_version.py
wscript

index 31103e0f8c4cd8819e67201ecb44aaa1021f59a9..576168f5723de58e3b41620c0ca91cdb41f4b3db 100644 (file)
@@ -253,6 +253,11 @@ def samba_version_file(version_file, path, env=None, is_install=True):
                 print("Failed to parse line %s from %s" % (line, version_file))
                 raise
 
+    if "SAMBA_VERSION_VENDOR_SUFFIX" in env:
+        version_dict["SAMBA_VERSION_VENDOR_SUFFIX"] = env.SAMBA_VERSION_VENDOR_SUFFIX
+    if "SAMBA_VERSION_VENDOR_PATCH" in env:
+        version_dict["SAMBA_VERSION_VENDOR_PATCH"] = str(env.SAMBA_VERSION_VENDOR_PATCH)
+
     return SambaVersion(version_dict, path, env=env, is_install=is_install)
 
 
diff --git a/wscript b/wscript
index 95ddd9ef5ba3f5fd4f6e181047eba5537ab452a5..4b183fd375ce9ed634d07e69415a41b45026b023 100644 (file)
--- a/wscript
+++ b/wscript
@@ -140,7 +140,27 @@ def options(opt):
                                dest='with_smb1server',
                                help=("Build smbd with SMB1 support (default=yes)."))
 
+    opt.add_option('--vendor-name',
+                   help=('Specify a vendor (or packager) name to include in the version string'),
+                   type="string",
+                   dest='SAMBA_VERSION_VENDOR_SUFFIX',
+                   default=None)
+
+    opt.add_option('--vendor-patch-revision',
+                   help=('Specify a vendor (or packager) patch revision number include in the version string (requires --vendor-name)'),
+                   type="int",
+                   dest='SAMBA_VERSION_VENDOR_PATCH',
+                   default=None)
+
 def configure(conf):
+    if Options.options.SAMBA_VERSION_VENDOR_SUFFIX:
+        conf.env.SAMBA_VERSION_VENDOR_SUFFIX = Options.options.SAMBA_VERSION_VENDOR_SUFFIX
+
+    if Options.options.SAMBA_VERSION_VENDOR_PATCH:
+        if not Options.options.SAMBA_VERSION_VENDOR_SUFFIX:
+            raise conf.fatal('--vendor-patch-revision requires --vendor-version')
+        conf.env.SAMBA_VERSION_VENDOR_PATCH = Options.options.SAMBA_VERSION_VENDOR_PATCH
+
     version = samba_version.load_version(env=conf.env)
 
     conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)