From: Zac Medico Date: Mon, 12 Sep 2011 03:06:27 +0000 (-0700) Subject: save-ebuild-env.sh: tweak PYTHONPATH cleansing X-Git-Tag: v2.2.0_alpha56~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9fd712873f8f974089bbd4ab43f3ff4bd3308aa9;p=portage.git save-ebuild-env.sh: tweak PYTHONPATH cleansing --- 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