From: Ralph Boehme Date: Fri, 29 Mar 2019 17:18:27 +0000 (+0100) Subject: waf: only set mandatory to False if not already set by the caller X-Git-Tag: tdb-1.4.1~284 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbee3037a293273191c2c0c12a162589e01c884b;p=thirdparty%2Fsamba.git waf: only set mandatory to False if not already set by the caller There are a bunch of callers that call find_program with mandatory=True, we should not overwrite this when explicity passed, eg: ctx.find_program('objcopy', var='OBJCOPY', mandatory=True) conf.SAMBA_CHECK_PERL(mandatory=True) -> conf.find_program('perl', var='PERL', mandatory=mandatory) With this patch we only change the default from False to True, but allow callers to choose specific behaviour. Signed-off-by: Ralph Boehme Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Mon Apr 29 17:07:02 UTC 2019 on sn-devel-184 --- diff --git a/buildtools/wafsamba/samba_waf18.py b/buildtools/wafsamba/samba_waf18.py index cc310fbf512..c0bb6bfcf55 100644 --- a/buildtools/wafsamba/samba_waf18.py +++ b/buildtools/wafsamba/samba_waf18.py @@ -132,7 +132,9 @@ class ConfigurationContext(Configure.ConfigurationContext): return super(ConfigurationContext, self).init_dirs() def find_program_samba(self, *k, **kw): - kw['mandatory'] = False + # Override the waf default set in the @conf decorator in Configure.py + if 'mandatory' not in kw: + kw['mandatory'] = False ret = self.find_program_old(*k, **kw) return ret Configure.ConfigurationContext.find_program_old = Configure.ConfigurationContext.find_program