Browse code

Add defaults for yum proxy variables

Without these defaults, sourcing functions-common with -u turned on
(as say ./tools/build_wheels.sh does) will bail out with unset
variable errors. Also fix up quoting, and add no_proxy for zypper run

Change-Id: Ideb441634243c1c5ce7db3a375c2d98617e9d1dc

Ian Wienand authored on 2015/03/13 09:50:02
Showing 1 changed files
... ...
@@ -1019,8 +1019,8 @@ function yum_install {
1019 1019
     # The manual check for missing packages is because yum -y assumes
1020 1020
     # missing packages are OK.  See
1021 1021
     # https://bugzilla.redhat.com/show_bug.cgi?id=965567
1022
-    $sudo http_proxy=$http_proxy https_proxy=$https_proxy \
1023
-        no_proxy=$no_proxy \
1022
+    $sudo http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" \
1023
+        no_proxy="${no_proxy:-}" \
1024 1024
         ${YUM:-yum} install -y "$@" 2>&1 | \
1025 1025
         awk '
1026 1026
             BEGIN { fail=0 }
... ...
@@ -1042,7 +1042,8 @@ function zypper_install {
1042 1042
     [[ "$OFFLINE" = "True" ]] && return
1043 1043
     local sudo="sudo"
1044 1044
     [[ "$(id -u)" = "0" ]] && sudo="env"
1045
-    $sudo http_proxy=$http_proxy https_proxy=$https_proxy \
1045
+    $sudo http_proxy="${http_proxy:-}" https_proxy="${https_proxy:-}" \
1046
+        no_proxy="${no_proxy:-}" \
1046 1047
         zypper --non-interactive install --auto-agree-with-licenses "$@"
1047 1048
 }
1048 1049