diff options
-rw-r--r-- | bin/save-ebuild-env.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh index 3bb8255ab..a84a1258b 100644 --- a/bin/save-ebuild-env.sh +++ b/bin/save-ebuild-env.sh @@ -14,9 +14,13 @@ save_ebuild_env() { ( if has --exclude-init-phases $* ; then unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ - if [[ -n $PYTHONPATH ]] ; then - export PYTHONPATH=${PYTHONPATH/${PORTAGE_PYM_PATH}:} - [[ -z $PYTHONPATH ]] && unset PYTHONPATH + if [[ -n $PYTHONPATH && + ${PYTHONPATH%%:*} -ef $PORTAGE_PYM_PATH ]] ; then + if [[ $PYTHONPATH == *:* ]] ; then + export PYTHONPATH=${PYTHONPATH#*:} + else + unset PYTHONPATH + fi fi fi |