From f625ffe24f94a658adbe1a119df361cf84ef3a4d Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 5 Jun 2014 07:04:41 -0400 Subject: [PATCH] make get-pip.py download failures more clear curl dying ends up being a really unclear failure condition, and hard to fingerprint in the gate. We should make this much more explicit when we die. Also, don't trust the upstream filename, because all the rest of our logic would break if it changes anyway. Change-Id: Ibc2a96b33471d24c597af0d7af896fb10523156f --- tools/install_pip.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/install_pip.sh b/tools/install_pip.sh index d3f5e78a06..017e716ed4 100755 --- a/tools/install_pip.sh +++ b/tools/install_pip.sh @@ -25,6 +25,7 @@ source $TOP_DIR/functions FILES=$TOP_DIR/files PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py +LOCAL_PIP="$FILES/$(basename $PIP_GET_PIP_URL)" GetDistro echo "Distro: $DISTRO" @@ -41,12 +42,11 @@ function get_versions { function install_get_pip { - if [[ ! -r $FILES/get-pip.py ]]; then - (cd $FILES; \ - curl -O $PIP_GET_PIP_URL; \ - ) + if [[ ! -r $LOCAL_PIP ]]; then + curl -o $LOCAL_PIP $PIP_GET_PIP_URL || \ + die $LINENO "Download of get-pip.py failed" fi - sudo -E python $FILES/get-pip.py + sudo -E python $LOCAL_PIP }