From b376719fc0b1ce225a564c0d32091b53db408f6d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 20 Oct 2017 12:14:29 -0700 Subject: [PATCH] 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. Closes-Bug: #1764046 Change-Id: Ic7d0c04d7fa77774ab2d70fb9d11f182becec553 (cherry picked from commit 065779517f9c99a80fbc39d51784c614e4ee341c) --- inc/python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/python b/inc/python index 84d1959d8f..3bb56a3fd5 100644 --- a/inc/python +++ b/inc/python @@ -208,7 +208,7 @@ function pip_install { # packages like setuptools? local pip_version pip_version=$(python -c "import pip; \ - print(pip.__version__.strip('.')[0])") + print(pip.__version__.split('.')[0])") if (( pip_version<6 )); then die $LINENO "Currently installed pip version ${pip_version} does not" \ "meet minimum requirements (>=6)."