Merge "Fix dependency list generation corner cases"

This commit is contained in:
Jenkins 2012-03-10 00:45:30 +00:00 committed by Gerrit Code Review
commit cd6a530022
2 changed files with 14 additions and 10 deletions

View File

@ -4,7 +4,7 @@
# apt-get wrapper to set arguments correctly # apt-get wrapper to set arguments correctly
# apt_get package [package ...] # apt_get package [package ...]
function apt_get() { function apt_get() {
[[ "$OFFLINE" = "True" ]] && return [[ "$OFFLINE" = "True" || -z "$@" ]] && return
local sudo="sudo" local sudo="sudo"
[[ "$(id -u)" = "0" ]] && sudo="env" [[ "$(id -u)" = "0" ]] && sudo="env"
$sudo DEBIAN_FRONTEND=noninteractive \ $sudo DEBIAN_FRONTEND=noninteractive \
@ -124,7 +124,7 @@ function is_set() {
# pip install wrapper to set cache and proxy environment variables # pip install wrapper to set cache and proxy environment variables
# pip_install package [package ...] # pip_install package [package ...]
function pip_install { function pip_install {
[[ "$OFFLINE" = "True" ]] && return [[ "$OFFLINE" = "True" || -z "$@" ]] && return
sudo PIP_DOWNLOAD_CACHE=/var/cache/pip \ sudo PIP_DOWNLOAD_CACHE=/var/cache/pip \
HTTP_PROXY=$http_proxy \ HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \ HTTPS_PROXY=$https_proxy \

View File

@ -538,12 +538,16 @@ fi
# dist:DISTRO1,DISTRO2 it will be installed only for those # dist:DISTRO1,DISTRO2 it will be installed only for those
# distros (case insensitive). # distros (case insensitive).
function get_packages() { function get_packages() {
local file_to_parse="general" local package_dir=$1
local file_to_parse
local service local service
for service in ${ENABLED_SERVICES//,/ }; do if [[ -z "$package_dir" ]]; then
# Allow individual services to specify dependencies echo "No package directory supplied"
if [[ -e $FILES/apts/${service} ]]; then return 1
fi
for service in general ${ENABLED_SERVICES//,/ }; do # Allow individual services to specify dependencies
if [[ -e ${package_dir}/${service} ]]; then
file_to_parse="${file_to_parse} $service" file_to_parse="${file_to_parse} $service"
fi fi
if [[ $service == n-* ]]; then if [[ $service == n-* ]]; then
@ -562,9 +566,9 @@ function get_packages() {
done done
for file in ${file_to_parse}; do for file in ${file_to_parse}; do
local fname=${FILES}/apts/${file} local fname=${package_dir}/${file}
local OIFS line package distros distro local OIFS line package distros distro
[[ -e $fname ]] || { echo "missing: $fname"; exit 1 ;} [[ -e $fname ]] || continue
OIFS=$IFS OIFS=$IFS
IFS=$'\n' IFS=$'\n'
@ -590,10 +594,10 @@ function get_packages() {
# install apt requirements # install apt requirements
apt_get update apt_get update
apt_get install $(get_packages) apt_get install $(get_packages $FILES/apts)
# install python requirements # install python requirements
pip_install `cat $FILES/pips/* | uniq` pip_install $(get_packages $FILES/pips | sort -u)
# compute service # compute service
git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH git_clone $NOVA_REPO $NOVA_DIR $NOVA_BRANCH