From 226e92fa4d3d7bcc2fdb090a40dc1ba082eb5e6a Mon Sep 17 00:00:00 2001 From: Ghe Rivero Date: Wed, 2 Jul 2014 10:55:43 +0000 Subject: [PATCH] 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 --- elements/yum/bin/install-packages | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/elements/yum/bin/install-packages b/elements/yum/bin/install-packages index 68409afd0..c845c6622 100755 --- a/elements/yum/bin/install-packages +++ b/elements/yum/bin/install-packages @@ -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