Bumping manifests a=b2g-bump
[gecko.git] / python / virtualenv / virtualenv_embedded / activate.sh
blobe50c78256c9c62efb5b59844ea3a12f373f46b7c
1 # This file must be used with "source bin/activate" *from bash*
2 # you cannot run it directly
4 deactivate () {
5 unset pydoc
7 # reset old environment variables
8 if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
9 PATH="$_OLD_VIRTUAL_PATH"
10 export PATH
11 unset _OLD_VIRTUAL_PATH
13 if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
14 PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
15 export PYTHONHOME
16 unset _OLD_VIRTUAL_PYTHONHOME
19 # This should detect bash and zsh, which have a hash command that must
20 # be called to get it to forget past commands. Without forgetting
21 # past commands the $PATH changes we made may not be respected
22 if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
23 hash -r 2>/dev/null
26 if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
27 PS1="$_OLD_VIRTUAL_PS1"
28 export PS1
29 unset _OLD_VIRTUAL_PS1
32 unset VIRTUAL_ENV
33 if [ ! "$1" = "nondestructive" ] ; then
34 # Self destruct!
35 unset -f deactivate
39 # unset irrelevant variables
40 deactivate nondestructive
42 VIRTUAL_ENV="__VIRTUAL_ENV__"
43 export VIRTUAL_ENV
45 _OLD_VIRTUAL_PATH="$PATH"
46 PATH="$VIRTUAL_ENV/__BIN_NAME__:$PATH"
47 export PATH
49 # unset PYTHONHOME if set
50 # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
51 # could use `if (set -u; : $PYTHONHOME) ;` in bash
52 if [ -n "$PYTHONHOME" ] ; then
53 _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
54 unset PYTHONHOME
57 if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
58 _OLD_VIRTUAL_PS1="$PS1"
59 if [ "x__VIRTUAL_PROMPT__" != x ] ; then
60 PS1="__VIRTUAL_PROMPT__$PS1"
61 else
62 if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
63 # special case for Aspen magic directories
64 # see http://www.zetadev.com/software/aspen/
65 PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
66 else
67 PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
70 export PS1
73 alias pydoc="python -m pydoc"
75 # This should detect bash and zsh, which have a hash command that must
76 # be called to get it to forget past commands. Without forgetting
77 # past commands the $PATH changes we made may not be respected
78 if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
79 hash -r 2>/dev/null