]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: normalize BOOL values found by get_cmake_variables() 31676/head
authorKefu Chai <kchai@redhat.com>
Tue, 26 Mar 2019 17:26:59 +0000 (01:26 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 18 Nov 2019 14:50:21 +0000 (22:50 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 44cb44425ce19ee293a0e0f012229cf2389ac271)

src/ceph.in

index 64c900dcd9e911d040af444bea489eaf515cb697..78529616820ddcbb8e27d1f5fcbb734922b18f39 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