From f0cd9a8b08d92524fc8e2c3f05d08cdebc638e2a Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 6 Oct 2017 13:11:48 -0500 Subject: [PATCH] Update lib_install_from_git to use column format The pip list command supports a --format=columns option which outputs things in space delimited columns. Switch to using that. Change-Id: I5140a7d83bf567b1c3c67516112eb4c57074fa53 --- inc/python | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inc/python b/inc/python index 9c810ec9b9..686efd40cf 100644 --- a/inc/python +++ b/inc/python @@ -415,11 +415,11 @@ function lib_installed_from_git { # you the path an editable install was installed from; for example # in response to something like # pip install -e 'git+http://git.openstack.org/openstack-dev/bashate#egg=bashate' - # pip list shows - # bashate (0.5.2.dev19, /tmp/env/src/bashate) - # Thus we look for "path after a comma" to indicate we were - # installed from some local place - pip list 2>/dev/null | grep -- "$name" | grep -q -- ', .*)$' + # pip list --format columns shows + # bashate 0.5.2.dev19 /tmp/env/src/bashate + # Thus we check the third column to see if we're installed from + # some local place. + [[ -z $(pip list --format=columns 2>/dev/null | awk "/^$name/ {print \$3}") ]] } # check that everything that's in LIBS_FROM_GIT was actually installed