From 9fa65af1ec77a646057fb4b8d148498f0596b020 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 13 May 2014 17:13:55 +0200 Subject: [PATCH] Add hash/rehash commands at the end of the scripts in . --- bootstrap/coriolisEnv.py | 51 +++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index f3e3aab4..462143d7 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -122,23 +122,23 @@ if __name__ == "__main__": strippedPythonPath = stripPath ( "PYTHONPATH" ) shellScriptSh = \ - """echo "%(MESSAGE)s";\n""" \ - """echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \ - """PATH="%(PATH)s";\n""" \ - """BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n""" \ - """CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n""" \ - """STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \ - """export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n""" \ - """hash -r;\n""" + 'echo "%(MESSAGE)s";\n' \ + 'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \ + 'PATH="%(PATH)s";\n' \ + 'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n' \ + 'CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n' \ + 'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \ + 'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n' \ + 'hash -r;\n' shellScriptCsh = \ - """echo "%(MESSAGE)s";\n""" \ - """echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \ - """setenv PATH "%(PATH)s";\n""" \ - """setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n""" \ - """setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n""" \ - """setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \ - """rehash\n;""" + 'echo "%(MESSAGE)s";\n' \ + 'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \ + 'setenv PATH "%(PATH)s";\n' \ + 'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n' \ + 'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n' \ + 'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \ + 'rehash\n;' buildDir = buildType + "." + linkType scriptDir = os.path.dirname ( os.path.abspath(__file__) ) @@ -176,18 +176,21 @@ if __name__ == "__main__": strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath - shellScriptSh += """PYTHONPATH="%(PYTHONPATH)s";\n""" \ - """export PYTHONPATH;\n""" - shellScriptCsh += """setenv PYTHONPATH "%(PYTHONPATH)s";""" + shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \ + 'export PYTHONPATH;\n' + shellScriptCsh += 'setenv PYTHONPATH "%(PYTHONPATH)s";' if osType == "Darwin": - shellScriptSh += """DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \ - """export DYLD_LIBRARY_PATH;\n""" - shellScriptCsh += """setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" + shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \ + 'export DYLD_LIBRARY_PATH;\n' + shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' else: - shellScriptSh += """LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \ - """export LD_LIBRARY_PATH;\n""" - shellScriptCsh += """setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" + shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \ + 'export LD_LIBRARY_PATH;\n' + shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' + + shellScriptSh += "hash -r;\n" + shellScriptCSh += "rehash;\n" if options.csh: shellScript = shellScriptCsh else: shellScript = shellScriptSh