Add hash/rehash commands at the end of the scripts in <coriolisEnv.py>.

This commit is contained in:
Jean-Paul Chaput 2014-05-13 17:13:55 +02:00
parent 724d92f816
commit 9fa65af1ec
1 changed files with 27 additions and 24 deletions

View File

@ -122,23 +122,23 @@ if __name__ == "__main__":
strippedPythonPath = stripPath ( "PYTHONPATH" ) strippedPythonPath = stripPath ( "PYTHONPATH" )
shellScriptSh = \ shellScriptSh = \
"""echo "%(MESSAGE)s";\n""" \ 'echo "%(MESSAGE)s";\n' \
"""echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \ 'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \
"""PATH="%(PATH)s";\n""" \ 'PATH="%(PATH)s";\n' \
"""BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n""" \ 'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n' \
"""CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n""" \ 'CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n' \
"""STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \ 'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \
"""export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n""" \ 'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n' \
"""hash -r;\n""" 'hash -r;\n'
shellScriptCsh = \ shellScriptCsh = \
"""echo "%(MESSAGE)s";\n""" \ 'echo "%(MESSAGE)s";\n' \
"""echo "Switching to Coriolis 2.x (%(buildDir)s)";\n""" \ 'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \
"""setenv PATH "%(PATH)s";\n""" \ 'setenv PATH "%(PATH)s";\n' \
"""setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n""" \ 'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n' \
"""setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n""" \ 'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n' \
"""setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n""" \ 'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \
"""rehash\n;""" 'rehash\n;'
buildDir = buildType + "." + linkType buildDir = buildType + "." + linkType
scriptDir = os.path.dirname ( os.path.abspath(__file__) ) scriptDir = os.path.dirname ( os.path.abspath(__file__) )
@ -176,18 +176,21 @@ if __name__ == "__main__":
strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
shellScriptSh += """PYTHONPATH="%(PYTHONPATH)s";\n""" \ shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \
"""export PYTHONPATH;\n""" 'export PYTHONPATH;\n'
shellScriptCsh += """setenv PYTHONPATH "%(PYTHONPATH)s";""" shellScriptCsh += 'setenv PYTHONPATH "%(PYTHONPATH)s";'
if osType == "Darwin": if osType == "Darwin":
shellScriptSh += """DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \ shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \
"""export DYLD_LIBRARY_PATH;\n""" 'export DYLD_LIBRARY_PATH;\n'
shellScriptCsh += """setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n'
else: else:
shellScriptSh += """LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" \ shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \
"""export LD_LIBRARY_PATH;\n""" 'export LD_LIBRARY_PATH;\n'
shellScriptCsh += """setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n""" shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n'
shellScriptSh += "hash -r;\n"
shellScriptCSh += "rehash;\n"
if options.csh: shellScript = shellScriptCsh if options.csh: shellScript = shellScriptCsh
else: shellScript = shellScriptSh else: shellScript = shellScriptSh