Browse code

Properly get pip version

The old code was strip()ing the version string instead of split()ing the
version string so we always got the first character of the version
string. This worked fine as long as the pip version was single digit but
as soon as it rolls over to '10.stuff' we will compare:

pip version 1 (instead of 10) > 6

Which fails bceause 1 is less than six. Instaed we really do want to
compare 10 > 6 so use split on '.' instead.

Change-Id: Ic7d0c04d7fa77774ab2d70fb9d11f182becec553

Clark Boylan authored on 2017/10/21 04:14:29
Showing 1 changed files
... ...
@@ -333,7 +333,7 @@ function pip_install {
333 333
     # packages like setuptools?
334 334
     local pip_version
335 335
     pip_version=$(python -c "import pip; \
336
-                        print(pip.__version__.strip('.')[0])")
336
+                        print(pip.__version__.split('.')[0])")
337 337
     if (( pip_version<6 )); then
338 338
         die $LINENO "Currently installed pip version ${pip_version} does not" \
339 339
             "meet minimum requirements (>=6)."