wafsamba: fix '--private-libraries' option when using 'ALL,!something'
authorStefan Metzmacher <metze@samba.org>
Thu, 1 Jul 2021 10:08:11 +0000 (12:08 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 30 Nov 2021 15:53:34 +0000 (15:53 +0000)
We already had the desired logic in LIB_MUST_BE_BUNDLED(), so we can
just reuse it in LIB_MUST_BE_PRIVATE().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
buildtools/wafsamba/samba_bundled.py
buildtools/wafsamba/wscript

index 5f080dd8a7a6687ca836b5a23d6837cd93a047b5..6ca6cde0e25cf44c71fe1854e41ad1c8671a04bc 100644 (file)
@@ -95,20 +95,22 @@ def LIB_MAY_BE_BUNDLED(conf, libname):
         return False
     return True
 
-@conf
-def LIB_MUST_BE_BUNDLED(conf, libname):
-    if libname in conf.env.BUNDLED_LIBS:
+def __LIB_MUST_BE(liblist, libname):
+    if libname in liblist:
         return True
-    if '!%s' % libname in conf.env.BUNDLED_LIBS:
+    if '!%s' % libname in liblist:
         return False
-    if 'ALL' in conf.env.BUNDLED_LIBS:
+    if 'ALL' in liblist:
         return True
     return False
 
+@conf
+def LIB_MUST_BE_BUNDLED(conf, libname):
+    return __LIB_MUST_BE(conf.env.BUNDLED_LIBS, libname)
+
 @conf
 def LIB_MUST_BE_PRIVATE(conf, libname):
-    return ('ALL' in conf.env.PRIVATE_LIBS or
-            libname in conf.env.PRIVATE_LIBS)
+    return __LIB_MUST_BE(conf.env.PRIVATE_LIBS, libname)
 
 @conf
 def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
index d13dbd9791262ca5bce75fd71a7e2f6276f1ee37..12999c0622c27477b0745ed17f8ceff51f7919e4 100644 (file)
@@ -34,7 +34,7 @@ def options(opt):
                    action="store", dest='BUNDLED_LIBS', default='')
 
     gr.add_option('--private-libraries',
-                   help=("comma separated list of normally public libraries to build instead as private libraries. May include !LIBNAME to disable making a library private. Can be 'NONE' or 'ALL' [auto]"),
+                   help=("comma separated list of normally public libraries to build instead as private libraries. May include !LIBNAME to disable making a library private in order to limit the effect of 'ALL'"),
                    action="store", dest='PRIVATE_LIBS', default='')
 
     extension_default = default_value('PRIVATE_EXTENSION_DEFAULT')