Browse code

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

Sean Dague authored on 2015/10/07 22:06:42
Showing 1 changed files
... ...
@@ -53,8 +53,15 @@ function install_get_pip {
53 53
     # since and only download if a new version is out -- but only if
54 54
     # it seems we downloaded the file originally.
55 55
     if [[ ! -r $LOCAL_PIP || -r $LOCAL_PIP.downloaded ]]; then
56
+        # only test freshness if LOCAL_PIP is actually there,
57
+        # otherwise we generate a scary warning.
58
+        local timecond=""
59
+        if [[ -r $LOCAL_PIP ]]; then
60
+            timecond="-z $LOCAL_PIP"
61
+        fi
62
+
56 63
         curl --retry 6 --retry-delay 5 \
57
-            -z $LOCAL_PIP -o $LOCAL_PIP $PIP_GET_PIP_URL || \
64
+            $timecond -o $LOCAL_PIP $PIP_GET_PIP_URL || \
58 65
             die $LINENO "Download of get-pip.py failed"
59 66
         touch $LOCAL_PIP.downloaded
60 67
     fi