]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: update for cmake path changes 8351/head
authorJohn Spray <john.spray@redhat.com>
Tue, 29 Mar 2016 11:22:00 +0000 (12:22 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 29 Mar 2016 12:42:40 +0000 (13:42 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/ceph.in

index 7fa4ebca0c6e4d0b4499675c0ca58f7337c00001..b1b898d52b17ad348478742c70d5d57bbe855ae1 100755 (executable)
@@ -72,41 +72,45 @@ def get_pythonlib_dir():
     f = "lib.{platform}-{version[0]}.{version[1]}"
     name = f.format(platform=sysconfig.get_platform(),
                     version=sys.version_info)
-    return os.path.join('build', name)
+    return name
 
 if MYDIR.endswith('src') and \
    os.path.exists(os.path.join(MYDIR, '.libs')) and \
    os.path.exists(os.path.join(MYDIR, 'pybind')) and \
    os.path.exists(os.path.join(MYDIR, 'build')):
 
-    pythonlib_path = get_pythonlib_dir()
-    respawn_in_path(os.path.join(MYDIR, '.libs'), "pybind", pythonlib_path)
+    respawn_in_path(os.path.join(MYDIR, '.libs'), "pybind/build",
+                                 get_pythonlib_dir())
     if os.environ.has_key('PATH') and MYDIR not in os.environ['PATH']:
         os.environ['PATH'] += ':' + MYDIR
 
 elif os.path.exists(os.path.join(os.getcwd(), "CMakeCache.txt")) \
-     and os.path.exists(os.path.join(os.getcwd(), "init-ceph")):
+     and os.path.exists(os.path.join(os.getcwd(), "bin/init-ceph")):
     src_path = None
     for l in open("./CMakeCache.txt").readlines():
         if l.startswith("Ceph_SOURCE_DIR:STATIC="):
             src_path = l.split("=")[1].strip()
 
+
     if src_path is None:
         # Huh, maybe we're not really in a cmake environment?
         pass
     else:
         # Developer mode, but in a cmake build dir instead of the src dir
-        lib_path = os.path.join(os.getcwd(), "src")
+        lib_path = os.path.join(os.getcwd(), "lib")
+        bin_path = os.path.join(os.getcwd(), "bin")
         pybind_path = os.path.join(src_path, "src", "pybind")
-        pythonlib_path = os.path.join(os.getcwd(), "../src/pybind", get_pythonlib_dir())
-        respawn_in_path(lib_path, pybind_path, pythonlib_path)
 
-        sys.path.insert(0, os.path.join(MYDIR, pybind_path))
-        sys.path.insert(0, os.path.join(MYDIR, pythonlib_path))
+        import sysconfig
+        f = "lib.{platform}-{version[0]}.{version[1]}"
+        name = f.format(platform=sysconfig.get_platform(),
+                        version=sys.version_info)
+        pythonlib_path = os.path.join(os.getcwd(), "lib/cython_modules", name)
+
+        respawn_in_path(lib_path, pybind_path, pythonlib_path)
 
-    # Add src/ to path for e.g. ceph-conf
-    if os.environ.has_key('PATH') and lib_path not in os.environ['PATH']:
-        os.environ['PATH'] += ':' + lib_path
+        if os.environ.has_key('PATH') and bin_path not in os.environ['PATH']:
+            os.environ['PATH'] += ':' + bin_path
 
 import argparse
 import errno