From 2babf3963f4eea8558b0c287c51e6faeb7069c70 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Sun, 3 Jan 2016 20:20:12 +0000 Subject: [PATCH] Don't die when yum fails. Not all yum failures has to be considered catastrofic failures also because install_package function should implement the same behavior in Fedora, CentOS and Ubuntu. Let return the error to be solved at higher level. Change-Id: Ia33bb98f47017f6ec00eb3b7261ed42d72efc573 Closes-Bug: #1522590 --- functions-common | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/functions-common b/functions-common index cb2998bfcd..d7d8299ad0 100644 --- a/functions-common +++ b/functions-common @@ -1300,13 +1300,17 @@ function yum_install { BEGIN { fail=0 } /No package/ { fail=1 } { print } - END { exit fail }' || \ - die $LINENO "Missing packages detected" + END { exit fail }' + result=$? - # also ensure we catch a yum failure - if [[ ${PIPESTATUS[0]} != 0 ]]; then - die $LINENO "${YUM:-yum} install failure" + if [ $result != 0 ]; then + echo $LINENO "Missing packages detected" + elif [[ ${PIPESTATUS[0]} != 0 ]]; then + # also ensure we catch a yum failure + echo $LINENO "${YUM:-yum} install failure" + result=1 fi + return $result } # zypper wrapper to set arguments correctly