From 2f81f454e68d63e18f32831c7fc53750c57bff30 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 9 Feb 2020 00:47:11 +0100 Subject: [PATCH] Updating socInstaller.py for docker cases. * New: In bootstrap/socInstaller.py, partial redesign of group of commands to better handles all the cases. Added support for docker context, and added Alliance compilation "alongside" Coriolis (merged install tree). * Change: In bootstrap/coriolisEnv.py, when run in a docker container we no longer can trust the kernel name to guess the OS, as the kernel is the one of the host and not the docker guest. This was causing problem for determining the Python site-package directory. Now just check all possible locations and stop at the first directory found. --- bootstrap/coriolisEnv.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index 098e2003..78a21ce8 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -130,7 +130,6 @@ def guessOs (): print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1] print " (using: \"%s\")" % osType - ldLibraryPath = os.getenv('LD_LIBRARY_PATH') if ldLibraryPath and 'devtoolset' in ldLibraryPath: useDevtoolset = False @@ -273,16 +272,25 @@ if __name__ == "__main__": if not options.nopython: pyVersion = sys.version_info version = "%d.%d" % (pyVersion[0],pyVersion[1]) - if osType.startswith("Linux.SL") \ - or osType.startswith("Linux.sl") \ - or osType.startswith("Linux.el") \ - or osType.startswith("Linux.fc") \ - or osType.startswith("Cygwin"): - sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) - elif osType.startswith("Darwin"): - sitePackagesDir = "%s/%s/site-packages" % (absLibDir,version) - else: - sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) + #if osType.startswith("Linux.SL") \ + # or osType.startswith("Linux.sl") \ + # or osType.startswith("Linux.el") \ + # or osType.startswith("Linux.fc") \ + # or osType.startswith("Cygwin"): + # sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) + #elif osType.startswith("Darwin"): + # sitePackagesDir = "%s/%s/site-packages" % (absLibDir,version) + #else: + # sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) + + sitePackagesDir = "sitePackageDir_has_been_not_found" + for pyPackageDir in [ "%s/python%s/site-packages" % (absLibDir,version) + , "%s/python%s/dist-packages" % (absLibDir,version) + , "%s/%s/site-packages" % (absLibDir,version) + ]: + if os.path.isdir(pyPackageDir): + sitePackagesDir = pyPackageDir + break strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath