From 9fd712873f8f974089bbd4ab43f3ff4bd3308aa9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 11 Sep 2011 20:06:27 -0700 Subject: [PATCH] save-ebuild-env.sh: tweak PYTHONPATH cleansing --- bin/save-ebuild-env.sh | 10 +++++++--- 1 file 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 -- 2.26.2