Browse code

Merge "Add a get_pip_command function"

Jenkins authored on 2012/12/04 02:05:04
Showing 2 changed files
... ...
@@ -645,11 +645,7 @@ function pip_install {
645 645
         SUDO_PIP="env"
646 646
     else
647 647
         SUDO_PIP="sudo"
648
-        if [[ "$os_PACKAGE" = "deb" ]] || is_suse; then
649
-            CMD_PIP=/usr/bin/pip
650
-        else
651
-            CMD_PIP=/usr/bin/pip-python
652
-        fi
648
+        CMD_PIP=$(get_pip_command)
653 649
     fi
654 650
     if [[ "$PIP_USE_MIRRORS" != "False" ]]; then
655 651
         PIP_MIRROR_OPT="--use-mirrors"
... ...
@@ -1046,6 +1042,19 @@ function get_rootwrap_location() {
1046 1046
     fi
1047 1047
 }
1048 1048
 
1049
+# Get the path to the pip command.
1050
+# get_pip_command
1051
+function get_pip_command() {
1052
+    if [[ -z "$os_PACKAGE" ]]; then
1053
+        GetOSVersion
1054
+    fi
1055
+
1056
+    if [[ "$os_PACKAGE" = "deb" ]] || is_suse; then
1057
+        echo "/usr/bin/pip"
1058
+    else
1059
+        echo "/usr/bin/pip-python"
1060
+    fi
1061
+}
1049 1062
 
1050 1063
 # Check if qpid can be used on the current distro.
1051 1064
 # qpid_is_supported
... ...
@@ -107,11 +107,7 @@ done
107 107
 # Pips
108 108
 # ----
109 109
 
110
-if [[ "$os_PACKAGE" = "deb" ]]; then
111
-    CMD_PIP=/usr/bin/pip
112
-else
113
-    CMD_PIP=/usr/bin/pip-python
114
-fi
110
+CMD_PIP=$(get_pip_command)
115 111
 
116 112
 # Pip tells us what is currently installed
117 113
 FREEZE_FILE=$(mktemp --tmpdir freeze.XXXXXX)