Commit ade8bff9 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Use $TEST_HOME to override $HOME for testing

parent 5003ea96
Pipeline #737403 passed with stage
in 25 seconds
......@@ -10,25 +10,34 @@
# or submit itself to any jurisdiction. #
###############################################################################
# see cern_profile.sh for documentation
if ( -e "${HOME}" && ! -e "${HOME}/.nogrouplogin" ) then
if ( $?TEST_HOME ) then
set _home_dir="${TEST_HOME}"
else
if ( $?HOME ) then
set _home_dir="${HOME}"
else
set _home_dir=""
endif
endif
if ( -e "${_home_dir}" && ! -e "${_home_dir}/.nogrouplogin" ) then
# customization enabled
foreach _f ( %target_dir%/etc/cern_profile.d/*.csh )
source ${_f}
endforeach
if ( ! -e "${HOME}/.nolbenv" ) then
if ( ! -e "${_home_dir}/.nolbenv" ) then
# LbEnv enabled
# - check the requested flavour
if ( -e "${HOME}/.devLHCBLoginscript" ) then
if ( -e "${_home_dir}/.devLHCBLoginscript" ) then
# this is legacy for...
set _lbenv_flavour=testing
else
# this is the default
set _lbenv_flavour=stable
endif
if ( -e "${HOME}/.lbenv_flavour" ) then
if ( -e "${_home_dir}/.lbenv_flavour" ) then
# check the content of the special file
set _lbenv_flavour=`cat "${HOME}/.lbenv_flavour"`
set _lbenv_flavour=`cat "${_home_dir}/.lbenv_flavour"`
switch ("${_lbenv_flavour}")
case stable:
case testing:
......@@ -60,3 +69,4 @@ if ( -e "${HOME}" && ! -e "${HOME}/.nogrouplogin" ) then
endif
endif
endif
unset _home_dir
......@@ -29,25 +29,26 @@
# - `.devLHCBLoginscript`: if present, equivalent to `.lbenv_flavour` containing
# _testing_
#
if [ -e "${HOME}" -a ! \( -e "${HOME}/.nogrouplogin" \) ] ; then
_home_dir="${TEST_HOME:-${HOME}}"
if [ -e "${_home_dir}" -a ! \( -e "${_home_dir}/.nogrouplogin" \) ] ; then
# customization enabled
for _f in %target_dir%/etc/cern_profile.d/*.sh ; do
source ${_f}
done
if [ ! -e "${HOME}/.nolbenv" ] ; then
if [ ! -e "${_home_dir}/.nolbenv" ] ; then
# LbEnv enabled
# - check the requested flavour
if [ -e "${HOME}/.devLHCBLoginscript" ] ; then
if [ -e "${_home_dir}/.devLHCBLoginscript" ] ; then
# this is legacy for...
_lbenv_flavour=testing
else
# this is the default
_lbenv_flavour=stable
fi
if [ -e "${HOME}/.lbenv_flavour" ] ; then
if [ -e "${_home_dir}/.lbenv_flavour" ] ; then
# check the content of the special file
_lbenv_flavour=$(cat "${HOME}/.lbenv_flavour")
_lbenv_flavour=$(cat "${_home_dir}/.lbenv_flavour")
case "${_lbenv_flavour}" in
stable|testing|unstable) ;; # these are fine, nothing to do
*) _lbenv_flavour=stable ;; # anything else maps to stable
......@@ -73,3 +74,4 @@ if [ -e "${HOME}" -a ! \( -e "${HOME}/.nogrouplogin" \) ] ; then
fi
fi
fi
unset _home_dir
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