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

Strip LBSCRIPTS entries from PYTHONPATH

parent 7dfc1caf
Pipeline #977763 passed with stages
in 2 minutes and 31 seconds
......@@ -15,6 +15,10 @@ if ( ! $?LBENV_SOURCED ) then
set _host_os=`%target_dir%/bin/host_os`
if ( -e %lbenv_root%/$_host_os/bin/activate.csh ) then
if ( $?PYTHONPATH ) then
# strip LBSCRIPTS entries from PYTHONPATH because they would interfere with virtualenv
setenv PYTHONPATH `printenv PYTHONPATH | sed 's|[^:]\+/LBSCRIPTS/[^:]\+||g;s/::\+/:/g;s/:$//;s/^://'`
endif
source %lbenv_root%/$_host_os/bin/activate.csh
if ( `history 1 | wc -l` ) then
eval `python -m LbEnv --csh --siteroot %siteroot% !:2* || echo deactivate`
......
......@@ -15,6 +15,10 @@ if [ -z "$LBENV_SOURCED" ] ; then
_host_os=$(%target_dir%/bin/host_os)
if [ -e ${OVERRIDE_LBENVROOT:-%lbenv_root%/$_host_os}/bin/activate ] ; then
if [ -n "$PYTHONPATH" ] ; then
# strip LBSCRIPTS entries from PYTHONPATH because they would interfere with virtualenv
export PYTHONPATH=$(printenv PYTHONPATH | sed 's|[^:]\+/LBSCRIPTS/[^:]\+||g;s/::\+/:/g;s/:$//;s/^://')
fi
source ${OVERRIDE_LBENVROOT:-%lbenv_root%/$_host_os}/bin/activate
eval $(python -m LbEnv --sh --siteroot ${OVERRIDE_MYSITEROOT:-%siteroot%} "$@" || echo deactivate)
else
......
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