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.
(cherry pick of Ibc2a96b33471d24c597af0d7af896fb10523156f
because our file handling was wrong, and might as well make this
line up with what we're going to land in icehouse / master)
Change-Id: If176e3eabd131e0697c6a67211b7d182ca8045dd
... | ... |
@@ -25,6 +25,7 @@ source $TOP_DIR/functions |
25 | 25 |
FILES=$TOP_DIR/files |
26 | 26 |
|
27 | 27 |
PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py |
28 |
+LOCAL_PIP="$FILES/$(basename $PIP_GET_PIP_URL)" |
|
28 | 29 |
|
29 | 30 |
GetDistro |
30 | 31 |
echo "Distro: $DISTRO" |
... | ... |
@@ -40,13 +41,12 @@ function get_versions() { |
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
|
43 |
-function install_get_pip() { |
|
44 |
- if [[ ! -r $FILES/get-pip.py ]]; then |
|
45 |
- (cd $FILES; \ |
|
46 |
- curl $PIP_GET_PIP_URL; \ |
|
47 |
- ) |
|
43 |
+function install_get_pip { |
|
44 |
+ if [[ ! -r $LOCAL_PIP ]]; then |
|
45 |
+ curl -o $LOCAL_PIP $PIP_GET_PIP_URL || \ |
|
46 |
+ die $LINENO "Download of get-pip.py failed" |
|
48 | 47 |
fi |
49 |
- sudo python $FILES/get-pip.py |
|
48 |
+ sudo -E python $LOCAL_PIP |
|
50 | 49 |
} |
51 | 50 |
|
52 | 51 |
# Show starting versions |