Skip to content

Commit 2babf39

Browse files
author
Federico Ressi
committed
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
1 parent 828936c commit 2babf39

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

functions-common

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,13 +1300,17 @@ function yum_install {
13001300
BEGIN { fail=0 }
13011301
/No package/ { fail=1 }
13021302
{ print }
1303-
END { exit fail }' || \
1304-
die $LINENO "Missing packages detected"
1303+
END { exit fail }'
1304+
result=$?
13051305

1306-
# also ensure we catch a yum failure
1307-
if [[ ${PIPESTATUS[0]} != 0 ]]; then
1308-
die $LINENO "${YUM:-yum} install failure"
1306+
if [ $result != 0 ]; then
1307+
echo $LINENO "Missing packages detected"
1308+
elif [[ ${PIPESTATUS[0]} != 0 ]]; then
1309+
# also ensure we catch a yum failure
1310+
echo $LINENO "${YUM:-yum} install failure"
1311+
result=1
13091312
fi
1313+
return $result
13101314
}
13111315

13121316
# zypper wrapper to set arguments correctly

0 commit comments

Comments
 (0)