Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.2.x' into 4.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Jan 7, 2017
2 parents aa44e99 + 4cc8837 commit 3ab895b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
14 changes: 5 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
* context-dependent setup.py files (#4057)


## 4.2.14 (2017-01-06)
## 4.2.14 (2017-01-07)

### Improvements
* use install.rm_rf for TemporaryDirectory cleanup (#3425)
Expand All @@ -191,6 +191,7 @@
* fix potential errors in multi-channel export and offline clone (#3995)
* fix auxlib/packaging, git hashes are not limited to 7 characters (#4189)
* fix compatibility with requests >=2.12, add pyopenssl as dependency (#4059)
* fix #3287 activate in 4.1-4.2.3 clobbers non-conda PATH changes (#4211)

### Non-User-Facing Changes
* fix open-ended test failures relating to python 3.6 release (#4166)
Expand Down Expand Up @@ -334,14 +335,6 @@
* fix cio_test compatibility (#3395 via #3400)


## 4.1.12 (2016-09-08)

### Bug Fixes
* fix #2837 "File exists" in symlinked path with parallel activations (#3210)
* fix prune option when installing packages (#3354)
* change check for placeholder to be more friendly to long PATH (#3349)


## 4.2.4 (2016-08-18)

### Bug Fixes
Expand Down Expand Up @@ -478,13 +471,16 @@
* error and exit for install of packages that require conda minimum version 4.3, #3726
* fix conda/install.py single-file behavior, #3854
* fix open-ended test failures relating to python 3.6 release (#4167)
* fix #3287 activate in 4.1-4.2.3 clobbers non-conda PATH changes (#4211)


## 4.1.12 (2016-09-08)

* fix #2837 "File exists" in symlinked path with parallel activations, #3210
* fix prune option when installing packages, #3354
* change check for placeholder to be more friendly to long PATH, #3349


## 4.1.11 (2016-07-26)

* fix PS1 backup in activate script, #3135 via #3155
Expand Down
13 changes: 11 additions & 2 deletions shell/activate
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,24 @@ if (( $? != 0 )); then
fi

# Ensure we deactivate any scripts from the old env
_CONDA_HOLD=true
source "$_CONDA_DIR/deactivate"
unset _CONDA_HOLD

_NEW_PART=$("$_CONDA_DIR/conda" ..activate $_SHELL$EXT "$args")
if (( $? == 0 )); then
export CONDA_PATH_BACKUP="$PATH"
# export this to restore it upon deactivation
export CONDA_PS1_BACKUP="$PS1"

export PATH="$_NEW_PART:$PATH"
# look if the deactivate script left a placeholder for us
if [[ $PATH == *"CONDA_PATH_PLACEHOLDER"* ]]; then
# If it did, replace it with our _NEW_PART
export PATH="$(echo "$PATH" | sed -E "s|CONDA_PATH_PLACEHOLDER|$_NEW_PART|g")"
else
export PATH="$_NEW_PART:$PATH"
fi

# CONDA_DEFAULT_ENV is the shortest representation of how conda recognizes your env.
# It can be an env name, or a full path.
# Last date of change: 2016-06-21
Expand All @@ -79,7 +88,7 @@ if (( $? == 0 )); then
# Legacy support: CONDA_DEFAULT_ENV is either env name or full path if given as path.
# CONDA_PREFIX is always the full path, for consistency.
# Last date of change: 2016-06-21
firstpath=${PATH%%:*}
firstpath=${_NEW_PART%%:*}
export CONDA_PREFIX="$(echo ${firstpath} | sed "s|/bin$||")" &>/dev/null

# if CONDA_DEFAULT_ENV not in PS1, prepend it with parentheses
Expand Down
15 changes: 14 additions & 1 deletion shell/deactivate
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,22 @@ if (( $? == 0 )); then
IFS=$(echo -en "\n\b") && for f in $(find "$_CONDA_D" -iname "*.sh"); do source "$f"; done
fi

# get the activation path that would have been provided for this prefix
_LAST_ACTIVATE_PATH=$("$_CONDA_DIR/conda" ..activate $_SHELL$EXT "$CONDA_PREFIX")

# in activate, we replace a placeholder so that conda keeps its place in the PATH order
# The activate script sets _CONDA_HOLD here to activate that behavior.
# Otherwise, PATH is simply removed.
if [ -n "$_CONDA_HOLD" ]; then
export PATH="$(echo "$PATH" | sed -E "s|$_LAST_ACTIVATE_PATH(:?)|CONDA_PATH_PLACEHOLDER\1|")"
else
export PATH="$(echo "$PATH" | sed -E "s|$_LAST_ACTIVATE_PATH(:?)||")"
fi

unset _LAST_ACTIVATE_PATH

unset CONDA_DEFAULT_ENV
unset CONDA_PREFIX
export PATH="$CONDA_PATH_BACKUP"
unset CONDA_PATH_BACKUP
export PS1="$CONDA_PS1_BACKUP"
unset CONDA_PS1_BACKUP
Expand Down
4 changes: 2 additions & 2 deletions tests/test_activate.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def test_activate_deactivate(shell):
assert_equals(stdout, u"%s" % shell_vars['base_path'])


@pytest.mark.installed
def test_activate_root(shell):
@pytest.mark.slow
def test_activate_root_simple(shell):
shell_vars = _format_vars(shell)
with TemporaryDirectory(prefix='envs', dir=dirname(__file__)) as envs:
commands = (shell_vars['command_setup'] + """
Expand Down

0 comments on commit 3ab895b

Please sign in to comment.