[PATCH] waf: Fix the build on openbsd

Alexander Bokovoy ab at samba.org
Tue Feb 3 02:06:47 MST 2015


On Mon, Feb 02, 2015 at 09:11:47PM +0100, Volker Lendecke wrote:
> Hi!
> 
> Review&push appreciated!
> 
> Thanks,
> 
> Volker
> 
> -- 
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de

> From 21bd8a56348b6b9584e116a8d91e0cd8fadd37d1 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Mon, 2 Feb 2015 21:08:25 +0100
> Subject: [PATCH] waf: Fix the build on openbsd
> 
> We have single-digit vnum='0', make the assignment deal with it
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  buildtools/wafadmin/Tools/ccroot.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/buildtools/wafadmin/Tools/ccroot.py b/buildtools/wafadmin/Tools/ccroot.py
> index d59cf26..12ef442 100644
> --- a/buildtools/wafadmin/Tools/ccroot.py
> +++ b/buildtools/wafadmin/Tools/ccroot.py
> @@ -184,7 +184,9 @@ def get_target_name(self):
>  			# the import lib file name stays unversionned.
>  			name = name + '-' + nums[0]
>  		elif self.env.DEST_OS == 'openbsd':
> -			pattern = '%s.%s.%s' % (pattern, nums[0], nums[1])
> +                        pattern = '%s.%s' % (pattern, nums[0])
> +                        if len(nums) >= 2:
> +                                pattern += '.%s' % nums[1]
I wonder if using a bit more of a Python would work too:
    pattern = '.'.join([pattern]+[str(d) for d in nums])

It works like this:
 >>> pattern='name.so'
 >>> nums=[0,2]
 >>> '.'.join([pattern]+[str(d) for d in nums])
 'name.so.0.2'
 >>> nums=[0]
 >>> '.'.join([pattern]+[str(d) for d in nums])
 'name.so.0'
 >>> 

-- 
/ Alexander Bokovoy


More information about the samba-technical mailing list