[Pkg-samba-maint] [samba] 01/03: Update debian/rules to allow support for multiple upstream ldb versions, when verified.

Jelmer Vernooij jelmer at moszumanska.debian.org
Fri Dec 5 01:01:01 UTC 2014


This is an automated email from the git hooks/post-receive script.

jelmer pushed a commit to branch master
in repository samba.

commit dd57db980d8009a4c20b1bc0589167a85848db1e
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Dec 4 21:03:56 2014 +0100

    Update debian/rules to allow support for multiple upstream ldb versions, when verified.
---
 debian/changelog          |  7 +++++++
 debian/ldb-compat.py      | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 debian/ldb-equiv-versions |  1 +
 debian/rules              |  5 +++--
 4 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cc7d776..2cdd465 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+samba (2:4.1.13+dfsg-3) UNRELEASED; urgency=medium
+
+  * Update debian/rules to allow support for multiple upstream ldb
+    versions, when verified.
+
+ -- Jelmer Vernooij <jelmer at debian.org>  Thu, 04 Dec 2014 21:03:54 +0100
+
 samba (2:4.1.13+dfsg-2) unstable; urgency=medium
 
   * Mask /etc/init.d/samba init script for systemd. This should make systemd
diff --git a/debian/ldb-compat.py b/debian/ldb-compat.py
new file mode 100755
index 0000000..99fa28a
--- /dev/null
+++ b/debian/ldb-compat.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# LDB has an unstable ABI for plugins that can change at a whim.
+# By default, the Samba package is conservative and only allows use of
+# the version against which it was built.
+#
+# debian/ldb-equiv-versions can list ldb versions for which the ABI hasn't changed.
+
+import optparse
+parser = optparse.OptionParser("[options] ldb-version")
+parser.add_option("--equivfile", dest="equivfile", type=str,
+                  default="debian/ldb-equiv-versions",
+                  help="File with ldb versions considered to be equivalent.")
+(opts, args) = parser.parse_args()
+
+if len(args) != 1:
+    parser.error("No version specified.")
+
+def parse_version(version):
+    return map(int, version.split('.'))
+
+def format_version(version):
+    return '.'.join(map(str, version))
+
+ldb_version = parse_version(args[0])
+
+def next_version(version):
+    x = list(version)
+    x[-1] = x[-1]+1
+    return format_version(x)
+
+f = open(opts.equivfile, 'r')
+try:
+    for l in f.readlines():
+        if l[0] == '#':
+            continue
+        (begin, end) = l.strip().split('-')
+        if (ldb_version < parse_version(begin) or
+            ldb_version > parse_version(end)):
+            continue
+        print begin
+        print next_version(parse_version(end))
+        break
+    else:
+        print format_version(ldb_version)
+        print next_version(ldb_version)
+finally:
+    f.close()
diff --git a/debian/ldb-equiv-versions b/debian/ldb-equiv-versions
new file mode 100644
index 0000000..0ae28a7
--- /dev/null
+++ b/debian/ldb-equiv-versions
@@ -0,0 +1 @@
+1.1.17-1.1.18
diff --git a/debian/rules b/debian/rules
index 383385c..08f7bbb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,8 +8,9 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 PYVERS=$(shell pyversions -vr)
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-LDB_VERSION = $(shell pkg-config --modversion ldb)
-LDB_NEXT_VERSION = $(shell python -c "x = '$(LDB_VERSION)'.split('.'); x[-1] = str(int(x[-1])+1); print '.'.join(x)")
+LDB_BUILD_VERSION = $(shell pkg-config --modversion ldb)
+LDB_VERSION = $(shell ./debian/ldb-compat.py $(LDB_BUILD_VERSION) | head -1)
+LDB_NEXT_VERSION = $(shell ./debian/ldb-compat.py $(LDB_BUILD_VERSION) | tail -1)
 # samba ships ldb modules, which are specific to the ldb version, so we need a
 # strict dependency on the upstream ldb version
 # this also mean samba needs a rebuild when the upstream ldb version changes

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list