File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,6 +406,9 @@ function use_library_from_git {
406406# determine if a package was installed from git
407407function lib_installed_from_git {
408408 local name=$1
409+ local safe_name
410+ safe_name=$( python -c " from pkg_resources import safe_name; \
411+ print(safe_name('${name} '))" )
409412 # Note "pip freeze" doesn't always work here, because it tries to
410413 # be smart about finding the remote of the git repo the package
411414 # was installed from. This doesn't work with zuul which clones
@@ -419,7 +422,7 @@ function lib_installed_from_git {
419422 # bashate 0.5.2.dev19 /tmp/env/src/bashate
420423 # Thus we check the third column to see if we're installed from
421424 # some local place.
422- [[ -n $( pip list --format=columns 2> /dev/null | awk " /^$name / {print \$ 3}" ) ]]
425+ [[ -n $( pip list --format=columns 2> /dev/null | awk " /^$safe_name / {print \$ 3}" ) ]]
423426}
424427
425428# check that everything that's in LIBS_FROM_GIT was actually installed
You can’t perform that action at this time.
0 commit comments