From a0cc2918adb4fc9f43c4f2e7f2cec9f46630636f Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 7 Oct 2015 09:06:42 -0400 Subject: [PATCH] fix warning in install_get_pip we were unconditionally adding -z to the curl command even if the file doesn't exist that we are referencing. That produces a scary warning for users. Lets not do that. Change-Id: Id2860c1c702510b0f8fd496abce579d0fa3ff867 --- tools/install_pip.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/install_pip.sh b/tools/install_pip.sh index 7b42c8c485..41261800e4 100755 --- a/tools/install_pip.sh +++ b/tools/install_pip.sh @@ -53,8 +53,15 @@ function install_get_pip { # since and only download if a new version is out -- but only if # it seems we downloaded the file originally. if [[ ! -r $LOCAL_PIP || -r $LOCAL_PIP.downloaded ]]; then + # only test freshness if LOCAL_PIP is actually there, + # otherwise we generate a scary warning. + local timecond="" + if [[ -r $LOCAL_PIP ]]; then + timecond="-z $LOCAL_PIP" + fi + curl --retry 6 --retry-delay 5 \ - -z $LOCAL_PIP -o $LOCAL_PIP $PIP_GET_PIP_URL || \ + $timecond -o $LOCAL_PIP $PIP_GET_PIP_URL || \ die $LINENO "Download of get-pip.py failed" touch $LOCAL_PIP.downloaded fi