Skip to content

Commit 6e91681

Browse files
committed
empty conda history instead of deleting it
conda uses the presence of this file as a magic indicator of conda envs so make it empty, not gone
1 parent 33ae3b0 commit 6e91681

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

repo2docker/buildpacks/conda/install-miniconda.bash

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ if [[ -f /tmp/kernel-environment.yml ]]; then
5757

5858
conda env create -n kernel -f /tmp/kernel-environment.yml
5959
${CONDA_DIR}/envs/kernel/bin/ipython kernel install --prefix "${CONDA_DIR}"
60-
rm -f ${CONDA_DIR}/envs/kernel/conda-meta/history
60+
echo '' > ${CONDA_DIR}/envs/kernel/conda-meta/history
6161
fi
62-
# remove conda history file,
62+
# empty conda history file,
6363
# which seems to result in some effective pinning of packages in the initial env,
64-
# which we don't intend
65-
rm -f ${CONDA_DIR}/conda-meta/history
64+
# which we don't intend.
65+
# this file must not be *removed*, however
66+
echo '' > ${CONDA_DIR}/envs/kernel/conda-meta/history
67+
6668
# Clean things out!
6769
conda clean -tipsy
6870

0 commit comments

Comments
 (0)