]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: introduce get_cmake_variable()
authorKefu Chai <kchai@redhat.com>
Thu, 8 Feb 2018 04:04:08 +0000 (12:04 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 11 Feb 2018 06:12:16 +0000 (14:12 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/vstart.sh

index ba2e87f888711c9ff67e38a5f226174354209626..33010abb81cb1bbd000ee18b49e6598a22b280ce 100755 (executable)
@@ -16,10 +16,15 @@ if [ -n "$VSTART_DEST" ]; then
   CEPH_OUT_DIR=$VSTART_DEST/out
 fi
 
+get_cmake_variable() {
+    local variable=$1
+    grep "$variable" CMakeCache.txt | cut -d "=" -f 2
+}
+
 # for running out of the CMake build directory
 if [ -e CMakeCache.txt ]; then
   # Out of tree build, learn source location from CMakeCache.txt
-  CEPH_ROOT=`grep ceph_SOURCE_DIR CMakeCache.txt | cut -d "=" -f 2`
+  CEPH_ROOT=$(get_cmake_variable ceph_SOURCE_DIR)
   CEPH_BUILD_DIR=`pwd`
   [ -z "$MGR_PYTHON_PATH" ] && MGR_PYTHON_PATH=$CEPH_ROOT/src/pybind/mgr
 fi