Avoid to install a blank list of packages

There are some situations where the list of packages to install
in a image is blank (packages blacklisted).

Change-Id: I315f97fe619c25b36cf47ed1b7a65936b753312e
This commit is contained in:
Ghe Rivero 2014-07-02 10:55:43 +00:00
parent 4fd84db547
commit 226e92fa4d

View File

@ -77,11 +77,15 @@ if [ -n "$WHITELIST" ]; then
else
PKGS=$(map-packages $WHITELIST)
fi
echo "Installing $PKGS"
yum -y $ACTION $EXTRA_ARGS $PKGS
for pkg in "$@"; do
if [ "$pkg" = "python-pip" ] ; then
alternatives --install /usr/bin/pip pip /usr/bin/pip-python 10
fi
done
if [ -z "${PKGS}" ]; then
echo "Not running install-packages $ACTION with empty packages list"
else
echo "Running install-packages ${ACTION}. Package list: $PKGS"
yum -y $ACTION $EXTRA_ARGS $PKGS
for pkg in "$@"; do
if [ "$pkg" = "python-pip" ] ; then
alternatives --install /usr/bin/pip pip /usr/bin/pip-python 10
fi
done
fi
fi