]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: normalize BOOL values found by get_cmake_variables()
authorKefu Chai <kchai@redhat.com>
Tue, 26 Mar 2019 17:26:59 +0000 (01:26 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 27 Mar 2019 01:55:43 +0000 (09:55 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph.in

index 51f844485c0a85c6ed6211226e49a0280f7d5d63..eea1f7809e19c505163209680b00bbef7cf7af81 100755 (executable)
@@ -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