[SCM] Samba Shared Repository - branch master updated
Stefan Metzmacher
metze at samba.org
Wed Nov 4 17:39:02 UTC 2015
The branch, master has been updated
via b06544d wafsamba: detect programmer errors in CHECK_BUNDLED_SYSTEM()
from c474173 tests: Add tests for net ads (join|leave)
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b06544da6f466affaa0ef6681e78673ef05b2c1e
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Aug 27 10:47:05 2015 +0200
wafsamba: detect programmer errors in CHECK_BUNDLED_SYSTEM()
All prerequisite libraries of CHECK_BUNDLED_SYSTEM[_PKG](onlyif='lib1 lib2')
need to be checked before.
That means conf.env['FOUND_SYSTEMLIB_lib1'] and conf.env['FOUND_SYSTEMLIB_lib2']
need to exist independed of its value (True or False). Otherwise this is a logic error.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11458
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Nov 4 18:38:18 CET 2015 on sn-devel-104
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/samba_bundled.py | 50 ++++++++++++++++++------------------
1 file changed, 25 insertions(+), 25 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index a4f841b..bfc7ecc 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -108,16 +108,6 @@ def LIB_MUST_BE_PRIVATE(conf, libname):
return ('ALL' in conf.env.PRIVATE_LIBS or
libname in conf.env.PRIVATE_LIBS)
- at conf
-def CHECK_PREREQUISITES(conf, prereqs):
- missing = []
- for syslib in TO_LIST(prereqs):
- f = 'FOUND_SYSTEMLIB_%s' % syslib
- if not f in conf.env:
- missing.append(syslib)
- return missing
-
-
@runonce
@conf
def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
@@ -142,11 +132,34 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
this first tries via pkg-config, then if that fails
tries by testing for a specified function in the specified lib
'''
- if conf.LIB_MUST_BE_BUNDLED(libname):
- return False
+ # We always do a logic validation of 'onlyif' first
+ missing = []
+ if onlyif:
+ for l in TO_LIST(onlyif):
+ f = 'FOUND_SYSTEMLIB_%s' % l
+ if not f in conf.env:
+ Logs.error('ERROR: CHECK_BUNDLED_SYSTEM(%s) - ' % (libname) +
+ 'missing prerequisite check for ' +
+ 'system library %s, onlyif=%r' % (l, onlyif))
+ sys.exit(1)
+ if not conf.env[f]:
+ missing.append(l)
found = 'FOUND_SYSTEMLIB_%s' % libname
if found in conf.env:
return conf.env[found]
+ if conf.LIB_MUST_BE_BUNDLED(libname):
+ conf.env[found] = False
+ return False
+
+ # see if the library should only use a system version if another dependent
+ # system version is found. That prevents possible use of mixed library
+ # versions
+ if missing:
+ if not conf.LIB_MAY_BE_BUNDLED(libname):
+ Logs.error('ERROR: Use of system library %s depends on missing system library/libraries %r' % (libname, missing))
+ sys.exit(1)
+ conf.env[found] = False
+ return False
def check_functions_headers_code():
'''helper function for CHECK_BUNDLED_SYSTEM'''
@@ -167,19 +180,6 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
return False
return True
-
- # see if the library should only use a system version if another dependent
- # system version is found. That prevents possible use of mixed library
- # versions
- if onlyif:
- missing = conf.CHECK_PREREQUISITES(onlyif)
- if missing:
- if not conf.LIB_MAY_BE_BUNDLED(libname):
- Logs.error('ERROR: Use of system library %s depends on missing system library/libraries %r' % (libname, missing))
- sys.exit(1)
- conf.env[found] = False
- return False
-
minversion = minimum_library_version(conf, libname, minversion)
msg = 'Checking for system %s' % libname
--
Samba Shared Repository
More information about the samba-cvs
mailing list