From 3df0a0839460d4ea723605d67d5561fc2b1b3966 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Tue, 8 Jul 2014 14:12:51 -0400 Subject: [PATCH] Echo output when pkg-map fails When the call to pkg-map fails, it prints the error to stdout. However, this output is lost when pkg-map is executed in a subshell, so the actual error is never seen. This change adds an explicit echo so the error is shown. Change-Id: Id6f4fae6acadfe2839b408fb2dd11fb65d65df6e --- elements/opensuse/bin/install-packages | 5 ++++- elements/yum/bin/install-packages | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/elements/opensuse/bin/install-packages b/elements/opensuse/bin/install-packages index d556c9db..2e0fd6fe 100755 --- a/elements/opensuse/bin/install-packages +++ b/elements/opensuse/bin/install-packages @@ -60,7 +60,10 @@ for i in "$@" do PKG_NAME=$i if [ -n "$MAP_ELEMENT" ]; then - PKG_NAME=$(pkg-map --element $MAP_ELEMENT $i) + if ! PKG_NAME=$(pkg-map --element $MAP_ELEMENT $i); then + echo "bin/pkg-map error. $PKG_NAME" + exit 1 + fi fi if [[ ! ${BLACKLIST[*]} =~ $PKG_NAME ]]; then WHITELIST+="$i " diff --git a/elements/yum/bin/install-packages b/elements/yum/bin/install-packages index 68409afd..b2481dc9 100755 --- a/elements/yum/bin/install-packages +++ b/elements/yum/bin/install-packages @@ -57,7 +57,10 @@ for i in "$@" do PKG_NAME=$i if [ -n "$MAP_ELEMENT" ]; then - PKG_NAME=$(pkg-map --element $MAP_ELEMENT $i) + if ! PKG_NAME=$(pkg-map --element $MAP_ELEMENT $i); then + echo "bin/pkg-map error. $PKG_NAME" + exit 1 + fi fi if [[ ! ${BLACKLIST[*]} =~ $PKG_NAME ]]; then WHITELIST="$WHITELIST $i"