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
This commit is contained in:
Federico Ressi 2016-01-03 20:20:12 +00:00
parent 828936c6ac
commit 2babf3963f

View File

@ -1300,13 +1300,17 @@ function yum_install {
BEGIN { fail=0 } BEGIN { fail=0 }
/No package/ { fail=1 } /No package/ { fail=1 }
{ print } { print }
END { exit fail }' || \ END { exit fail }'
die $LINENO "Missing packages detected" result=$?
# also ensure we catch a yum failure if [ $result != 0 ]; then
if [[ ${PIPESTATUS[0]} != 0 ]]; then echo $LINENO "Missing packages detected"
die $LINENO "${YUM:-yum} install failure" elif [[ ${PIPESTATUS[0]} != 0 ]]; then
# also ensure we catch a yum failure
echo $LINENO "${YUM:-yum} install failure"
result=1
fi fi
return $result
} }
# zypper wrapper to set arguments correctly # zypper wrapper to set arguments correctly