From: Kefu Chai Date: Tue, 26 Mar 2019 17:26:59 +0000 (+0800) Subject: ceph.in: normalize BOOL values found by get_cmake_variables() X-Git-Tag: v14.2.5~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=acf5aa6dd922b243058bb42e268d2896d49107fc;p=ceph.git ceph.in: normalize BOOL values found by get_cmake_variables() Signed-off-by: Kefu Chai (cherry picked from commit 44cb44425ce19ee293a0e0f012229cf2389ac271) --- diff --git a/src/ceph.in b/src/ceph.in index 64c900dcd9e9..78529616820d 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -102,7 +102,11 @@ def get_cmake_variables(*names): # parse lines like "WITH_ASAN:BOOL=ON" for name in names: if line.startswith("{}:".format(name)): - vars[name] = line.split("=")[1].strip() + type_value = line.split(":")[1].strip() + t, v = type_value.split("=") + if t == 'BOOL': + v = v.upper() in ('TRUE', '1', 'Y', 'YES', 'ON') + vars[name] = v break if all(vars.values()): break