Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 0bc8bc4143a58f91f6d7ce228b6763f377fdf45a Mon Sep 17 00:00:00 2001 |
| 2 | From: Andrew Bartlett <abartlet@samba.org> |
| 3 | Date: Thu, 12 Jul 2018 12:34:56 +1200 |
| 4 | Subject: [PATCH] ldb: Refuse to build Samba against a newer minor version of |
| 5 | ldb |
| 6 | |
| 7 | Samba is not compatible with new versions of ldb (except release versions) |
| 8 | |
| 9 | Other users would not notice the breakages, but Samba makes many |
| 10 | more assuptions about the LDB internals than any other package. |
| 11 | |
| 12 | (Specifically, LDB 1.2 and 1.4 broke builds against released |
| 13 | Samba versions) |
| 14 | |
| 15 | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13519 |
| 16 | |
| 17 | Signed-off-by: Andrew Bartlett <abartlet@samba.org> |
| 18 | Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> |
| 19 | (cherry picked from commit 52efa796538ae004ca62ea32fc8c833472991be6) |
| 20 | --- |
| 21 | lib/ldb/wscript | 32 ++++++++++++++++++++++---------- |
| 22 | 1 file changed, 22 insertions(+), 10 deletions(-) |
| 23 | |
| 24 | diff --git a/lib/ldb/wscript b/lib/ldb/wscript |
| 25 | index d94086b..2bb0832 100644 |
| 26 | --- a/lib/ldb/wscript |
| 27 | +++ b/lib/ldb/wscript |
| 28 | @@ -62,23 +62,33 @@ def configure(conf): |
| 29 | conf.env.standalone_ldb = conf.IN_LAUNCH_DIR() |
| 30 | |
| 31 | if not conf.env.standalone_ldb: |
| 32 | + max_ldb_version = [int(x) for x in VERSION.split(".")] |
| 33 | + max_ldb_version[2] = 999 |
| 34 | + max_ldb_version_dots = "%d.%d.%d" % tuple(max_ldb_version) |
| 35 | + |
| 36 | if conf.env.disable_python: |
| 37 | - if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION, |
| 38 | - onlyif='talloc tdb tevent', |
| 39 | - implied_deps='replace talloc tdb tevent'): |
| 40 | + if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', |
| 41 | + minversion=VERSION, |
| 42 | + maxversion=max_ldb_version_dots, |
| 43 | + onlyif='talloc tdb tevent', |
| 44 | + implied_deps='replace talloc tdb tevent'): |
| 45 | conf.define('USING_SYSTEM_LDB', 1) |
| 46 | else: |
| 47 | using_system_pyldb_util = True |
| 48 | - if not conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION, |
| 49 | - onlyif='talloc tdb tevent', |
| 50 | - implied_deps='replace talloc tdb tevent ldb'): |
| 51 | + if not conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', |
| 52 | + minversion=VERSION, |
| 53 | + maxversion=max_ldb_version_dots, |
| 54 | + onlyif='talloc tdb tevent', |
| 55 | + implied_deps='replace talloc tdb tevent ldb'): |
| 56 | using_system_pyldb_util = False |
| 57 | |
| 58 | # We need to get a pyldb-util for all the python versions |
| 59 | # we are building for |
| 60 | if conf.env['EXTRA_PYTHON']: |
| 61 | name = 'pyldb-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG'] |
| 62 | - if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION, |
| 63 | + if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, |
| 64 | + minversion=VERSION, |
| 65 | + maxversion=max_ldb_version_dots, |
| 66 | onlyif='talloc tdb tevent', |
| 67 | implied_deps='replace talloc tdb tevent ldb'): |
| 68 | using_system_pyldb_util = False |
| 69 | @@ -86,9 +96,11 @@ def configure(conf): |
| 70 | if using_system_pyldb_util: |
| 71 | conf.define('USING_SYSTEM_PYLDB_UTIL', 1) |
| 72 | |
| 73 | - if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION, |
| 74 | - onlyif='talloc tdb tevent pyldb-util', |
| 75 | - implied_deps='replace talloc tdb tevent'): |
| 76 | + if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', |
| 77 | + minversion=VERSION, |
| 78 | + maxversion=max_ldb_version_dots, |
| 79 | + onlyif='talloc tdb tevent pyldb-util', |
| 80 | + implied_deps='replace talloc tdb tevent'): |
| 81 | conf.define('USING_SYSTEM_LDB', 1) |
| 82 | |
| 83 | if conf.CONFIG_SET('USING_SYSTEM_LDB'): |
| 84 | -- |
| 85 | 2.18.0 |
| 86 | |