Merge "check LIBS_FROM_GIT"

This commit is contained in:
Jenkins 2015-09-11 19:14:22 +00:00 committed by Gerrit Code Review
commit a54c0d67fd
2 changed files with 29 additions and 0 deletions

View File

@ -157,6 +157,28 @@ function use_library_from_git {
return $enabled
}
# determine if a package was installed from git
function lib_installed_from_git {
local name=$1
pip freeze 2>/dev/null | grep -- "$name" | grep -q -- '-e git'
}
# check that everything that's in LIBS_FROM_GIT was actually installed
# correctly, this helps double check issues with library fat fingering.
function check_libs_from_git {
local lib=""
local not_installed=""
for lib in $(echo ${LIBS_FROM_GIT} | tr "," " "); do
if ! lib_installed_from_git "$lib"; then
not_installed+=" $lib"
fi
done
# if anything is not installed, say what it is.
if [[ -n "$not_installed" ]]; then
die $LINENO "The following LIBS_FROM_GIT were not installed correct: $not_installed"
fi
}
# setup a library by name. If we are trying to use the library from
# git, we'll do a git based install, otherwise we'll punt and the
# library should be installed by a requirements pull from another

View File

@ -1373,9 +1373,16 @@ if [[ -x $TOP_DIR/local.sh ]]; then
$TOP_DIR/local.sh
fi
# Sanity checks
# =============
# Check the status of running services
service_check
# ensure that all the libraries we think we installed from git,
# actually were.
check_libs_from_git
# Bash completion
# ===============