Commit 7dfc1caf authored by Ben Couturier's avatar Ben Couturier
Browse files

Merge branch 'Allow-overriding-of-hardcoded-siteroot' into 'master'

Allow overriding of hardcoded siteroot

See merge request !12
parents c829e724 cd8aa2d6
Pipeline #870855 passed with stages
in 3 minutes and 8 seconds
......@@ -14,11 +14,11 @@ if [ -z "$LBENV_SOURCED" ] ; then
export LBENV_FLAVOUR=%flavour%
_host_os=$(%target_dir%/bin/host_os)
if [ -e %lbenv_root%/$_host_os/bin/activate ] ; then
source %lbenv_root%/$_host_os/bin/activate
eval $(python -m LbEnv --sh --siteroot %siteroot% "$@" || echo deactivate)
if [ -e ${OVERRIDE_LBENVROOT:-%lbenv_root%/$_host_os}/bin/activate ] ; then
source ${OVERRIDE_LBENVROOT:-%lbenv_root%/$_host_os}/bin/activate
eval $(python -m LbEnv --sh --siteroot ${OVERRIDE_MYSITEROOT:-%siteroot%} "$@" || echo deactivate)
else
echo "Platform not supported ($_host_os)"
echo "Platform not supported: cannot find ${OVERRIDE_LBENVROOT:-%lbenv_root%/$_host_os}"
fi
unset _host_os
else
......
......@@ -60,13 +60,13 @@ if [ -e "${_home_dir}" -a ! \( -e "${_home_dir}/.nogrouplogin" \) ] ; then
fi
if [ "${_lbenv_flavour}" = stable ] ; then
# for the time being "stable" means LbLogin
if [ -z "$LBLOGIN_SOURCED" -a -e %target_dir%/lhcb/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh ] ; then
if [ -z "$LBLOGIN_SOURCED" -a -e ${OVERRIDE_MYSITEROOT:-%target_dir%}/lhcb/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh ] ; then
if [[ $- == *i* ]] ; then
# interactive shell: print banner
source %target_dir%/lhcb/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh
source ${OVERRIDE_MYSITEROOT:-%target_dir%}/lhcb/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh
else
# non-interactive: do not print
source %target_dir%/lhcb/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh >/dev/null 2>&1
source ${OVERRIDE_MYSITEROOT:-%target_dir%}/lhcb/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh >/dev/null 2>&1
fi
export LBLOGIN_SOURCED=1
fi
......
Markdown is supported
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