From 52347a0c983dedece08d5be6d3f1a237ed9d19ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Wed, 6 Aug 2014 00:10:43 -0300 Subject: [PATCH] Do not fail if buildpack dir is readonly --- bin/steps/python | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/steps/python b/bin/steps/python index 8d2384f..d36b316 100755 --- a/bin/steps/python +++ b/bin/steps/python @@ -52,22 +52,22 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then bpwatch start prepare_environment + TMPTARDIR=$(mktemp -d) + trap "rm -rf $TMPTARDIR" RETURN + bpwatch start install_setuptools # Prepare it for the real world # puts-step "Installing Setuptools ($SETUPTOOLS_VERSION)" - cd $ROOT_DIR/vendor/ - tar zxf setuptools-$SETUPTOOLS_VERSION.tar.gz - cd $ROOT_DIR/vendor/setuptools-$SETUPTOOLS_VERSION/ + tar zxf $ROOT_DIR/vendor/setuptools-$SETUPTOOLS_VERSION.tar.gz -C $TMPTARDIR + cd $TMPTARDIR/setuptools-$SETUPTOOLS_VERSION/ python setup.py install &> /dev/null cd $WORKING_DIR bpwatch stop install_setuptoools bpwatch start install_pip # puts-step "Installing Pip ($PIP_VERSION)" - - cd $ROOT_DIR/vendor/ - tar zxf pip-$PIP_VERSION.tar.gz - cd $ROOT_DIR/vendor/pip-$PIP_VERSION/ + tar zxf $ROOT_DIR/vendor/pip-$PIP_VERSION.tar.gz -C $TMPTARDIR + cd $TMPTARDIR/pip-$PIP_VERSION/ python setup.py install &> /dev/null cd $WORKING_DIR @@ -76,4 +76,4 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then fi set -e -hash -r \ No newline at end of file +hash -r