Commit d15d57d6 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Adapt cc-sh and cc-run to the new relocation strategy (CORALCOOL-2829)


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@19869 4525493e-7705-40b1-a816-d608a930855b
parent 09da60fc
......@@ -19,29 +19,37 @@ if [ "$1" == "" ]; then
exit 1
fi
# Use a modified xml config if this installation was relocated (CORALCOOL-2787)
# [No change in build.x86/TMP.install (else wrong) and in x86 (else waste time)]
# Relocate also python and all other externals for relocations out of jenkins
envxmlInitial=@env_release_xml@
topdirInitial=@CMAKE_INSTALL_PREFIX@
pythonExecutable=@PYTHON_EXECUTABLE@
# Override CORALSYS/COOLSYS and LCG_releases_base if this installation
# was relocated (CORALCOOL-2829; new relocation replacing CORALCOOL-2787)
# Relocate also python and all other externals for relocations out of lcgcmake
envxml=$topdir/env/@env_xml_basename@
if [ "$envxml" != "$envxmlInitial" ] && [ "$topdir" != "$topdirInitial" ]; then
tmpdir=/tmp/${USER}/@env_xml_basename@
mkdir -p $tmpdir
if [ ! -d $tmpdir ]; then tmpdir=/tmp; fi
tmpxml=`basename @env_xml_basename@ .xenv`
tmpxml=`mktemp ${tmpdir}/${tmpxml}.XXXXXXXXX.xenv`
cat $envxml | sed "s|${topdirInitial}|${topdir}|g" >> $tmpxml
envxml=$tmpxml
if [ "${topdirInitial}" != "${topdirInitial#/build/jenkins/workspace}" ]; then
insdirInitial=`dirname $topdirInitial`
insdirInitial=`dirname $insdirInitial`
insdirInitial=`dirname $insdirInitial`
insdir=`cd $topdir/../../..; pwd`
cat $tmpxml | sed "s|${insdirInitial}|${insdir}|g" > ${tmpxml}.new
\mv ${tmpxml}.new $tmpxml
pythonExecutable=`echo ${pythonExecutable} | sed "s|${insdirInitial}|${insdir}|"`
pythonExecutable=@PYTHON_EXECUTABLE@
project=`basename $envxml .xenv`
projsysold=`more $envxml | grep variable=\"${project}SYS\" | tr "<" " " | tr ">" " " | awk '{print $3}'`
if [ -d $projsysold ]; then projsysold=`cd $projsysold; pwd`; fi
projsysnew=$topdir
###echo projsysold is $projsysold
###echo projsysnew is $projsysnew
if [ "$projsysnew" != "$projsysold" ]; then # project was relocated
if [ "$project" == "CORAL" ]; then
export CORALSYS=$projsysnew
else
export COOLSYS=$projsysnew
fi
lcgrelold_lcgcmake=`dirname $projsysold`
lcgrelold_lcgcmake=`dirname $lcgrelold_lcgcmake`
lcgrelold_lcgcmake=`dirname $lcgrelold_lcgcmake`
lcgrelold=`more $envxml | grep variable=\"LCG_releases_base\" | tr "<" " " | tr ">" " " | awk '{print $3}'`
###echo lcgrelold_lcgcmake is $lcgrelold_lcgcmake
###echo lcgrelold is $lcgrelold
more $envxml | grep variable=\"LCG_releases_base\"
if [ "$lcgrelold" == "$lcgrelold_lcgcmake" ]; then # lcgcmake dir structure
lcgrelnew_lcgcmake=`dirname $projsysnew`
lcgrelnew_lcgcmake=`dirname $lcgrelnew_lcgcmake`
lcgrelnew_lcgcmake=`dirname $lcgrelnew_lcgcmake`
###echo lcgrelnew_lcgcmake is $lcgrelnew_lcgcmake
export LCG_releases_base=$lcgrelnew_lcgcmake
pythonExecutable=`echo ${pythonExecutable} | sed "s|${lcgrelold_lcgcmake}|${lcgrelnew_lcgcmake}|"`
fi
fi
......
......@@ -18,29 +18,37 @@ if [ ! -f $topdir/env/.bashrc ]; then
exit 1
fi
# Use a modified xml config if this installation was relocated (CORALCOOL-2787)
# [No change in build.x86/TMP.install (else wrong) and in x86 (else waste time)]
# Relocate also python and all other externals for relocations out of jenkins
envxmlInitial=@env_release_xml@
topdirInitial=@CMAKE_INSTALL_PREFIX@
pythonExecutable=@PYTHON_EXECUTABLE@
# Override CORALSYS/COOLSYS and LCG_releases_base if this installation
# was relocated (CORALCOOL-2829; new relocation replacing CORALCOOL-2787)
# Relocate also python and all other externals for relocations out of lcgcmake
envxml=$topdir/env/@env_xml_basename@
if [ "$envxml" != "$envxmlInitial" ] && [ "$topdir" != "$topdirInitial" ]; then
tmpdir=/tmp/${USER}/@env_xml_basename@
mkdir -p $tmpdir
if [ ! -d $tmpdir ]; then tmpdir=/tmp; fi
tmpxml=`basename @env_xml_basename@ .xenv`
tmpxml=`mktemp ${tmpdir}/${tmpxml}.XXXXXXXXX.xenv`
cat $envxml | sed "s|${topdirInitial}|${topdir}|g" >> $tmpxml
envxml=$tmpxml
if [ "${topdirInitial}" != "${topdirInitial#/build/jenkins/workspace}" ]; then
insdirInitial=`dirname $topdirInitial`
insdirInitial=`dirname $insdirInitial`
insdirInitial=`dirname $insdirInitial`
insdir=`cd $topdir/../../..; pwd`
cat $tmpxml | sed "s|${insdirInitial}|${insdir}|g" > ${tmpxml}.new
\mv ${tmpxml}.new $tmpxml
pythonExecutable=`echo ${pythonExecutable} | sed "s|${insdirInitial}|${insdir}|"`
pythonExecutable=@PYTHON_EXECUTABLE@
project=`basename $envxml .xenv`
projsysold=`more $envxml | grep variable=\"${project}SYS\" | tr "<" " " | tr ">" " " | awk '{print $3}'`
if [ -d $projsysold ]; then projsysold=`cd $projsysold; pwd`; fi
projsysnew=$topdir
###echo projsysold is $projsysold
###echo projsysnew is $projsysnew
if [ "$projsysnew" != "$projsysold" ]; then # project was relocated
if [ "$project" == "CORAL" ]; then
export CORALSYS=$projsysnew
else
export COOLSYS=$projsysnew
fi
lcgrelold_lcgcmake=`dirname $projsysold`
lcgrelold_lcgcmake=`dirname $lcgrelold_lcgcmake`
lcgrelold_lcgcmake=`dirname $lcgrelold_lcgcmake`
lcgrelold=`more $envxml | grep variable=\"LCG_releases_base\" | tr "<" " " | tr ">" " " | awk '{print $3}'`
###echo lcgrelold_lcgcmake is $lcgrelold_lcgcmake
###echo lcgrelold is $lcgrelold
more $envxml | grep variable=\"LCG_releases_base\"
if [ "$lcgrelold" == "$lcgrelold_lcgcmake" ]; then # lcgcmake dir structure
lcgrelnew_lcgcmake=`dirname $projsysnew`
lcgrelnew_lcgcmake=`dirname $lcgrelnew_lcgcmake`
lcgrelnew_lcgcmake=`dirname $lcgrelnew_lcgcmake`
###echo lcgrelnew_lcgcmake is $lcgrelnew_lcgcmake
export LCG_releases_base=$lcgrelnew_lcgcmake
pythonExecutable=`echo ${pythonExecutable} | sed "s|${lcgrelold_lcgcmake}|${lcgrelnew_lcgcmake}|"`
fi
fi
......@@ -48,7 +56,7 @@ fi
# [This was wrong as it did not identify and fix the real issue!]
###export PYTHONHOME=`dirname ${pythonExecutable}`
###export PYTHONHOME=`dirname ${PYTHONHOME}`
# Add protections against pre-existing PYTHONHOME and PYTHONPATH
# Add protections against pre-existing PYTHONHOME and PYTHONPATH
unset PYTHONHOME
unset PYTHONPATH
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment