Add default for YUM

This allows tools/* to use install_packages, etc, without having to
pull in stackrc for the $YUM definition.  Alternative to
Ief944af1ab177638bf818624a216751821e6330b

Change-Id: I7fe37079240e8cabbdffdcae5ad9d21e122e43c2
This commit is contained in:
Ian Wienand 2015-02-04 10:29:31 +11:00
parent 18e0a335b6
commit 36298eec00

@ -1208,7 +1208,7 @@ function uninstall_package {
if is_ubuntu; then
apt_get purge "$@"
elif is_fedora; then
sudo $YUM remove -y "$@" ||:
sudo ${YUM:-yum} remove -y "$@" ||:
elif is_suse; then
sudo zypper rm "$@"
else
@ -1229,7 +1229,7 @@ function yum_install {
# https://bugzilla.redhat.com/show_bug.cgi?id=965567
$sudo http_proxy=$http_proxy https_proxy=$https_proxy \
no_proxy=$no_proxy \
$YUM install -y "$@" 2>&1 | \
${YUM:-yum} install -y "$@" 2>&1 | \
awk '
BEGIN { fail=0 }
/No package/ { fail=1 }
@ -1239,7 +1239,7 @@ function yum_install {
# also ensure we catch a yum failure
if [[ ${PIPESTATUS[0]} != 0 ]]; then
die $LINENO "$YUM install failure"
die $LINENO "${YUM:-yum} install failure"
fi
}