From 36298eec001f900c00a8ac89143375620af9ce3e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 4 Feb 2015 10:29:31 +1100 Subject: [PATCH] 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 --- functions-common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions-common b/functions-common index 4d1c89ae15..1c114a156d 100644 --- a/functions-common +++ b/functions-common @@ -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 }