From 84d9c773a2727c6702871f7251bbdad53c6972be Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 5 Sep 2015 17:38:11 +0000 Subject: [PATCH] #673 review comments --- bootstrap/_rpm_common.sh | 48 ++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/bootstrap/_rpm_common.sh b/bootstrap/_rpm_common.sh index b1df5810a..2db1c7cfa 100755 --- a/bootstrap/_rpm_common.sh +++ b/bootstrap/_rpm_common.sh @@ -4,30 +4,26 @@ # - Fedora 22 (x64) # - Centos 7 (x64: on AWS EC2 t2.micro, DigitalOcean droplet) +if type yum 2>/dev/null +then + tool=yum +elif type dnf 2>/dev/null +then + tool=dnf +else + echo "Neither yum nor dnf found. Aborting bootstrap!" + exit 1 + # "git-core" seems to be an alias for "git" in CentOS 7 (yum search fails) -bootstrap() { - - pkgs="git-core - python - python-devel - python-virtualenv - python-devel - gcc dialog - augeas-libs - openssl-devel - libffi-devel - ca-certificates" - - if hash yum 2>/dev/null; then - yum install -y $pkgs; - - elif hash dnf 2>/dev/null; then - dnf install -y $pkgs; - - else - echo "Neither yum nor dnf found. Aborting bootstrap!" - exit 1; - - fi -} -bootstrap +$tool install -y \ + git-core \ + python \ + python-devel \ + python-virtualenv \ + python-devel \ + gcc \ + dialog \ + augeas-libs \ + openssl-devel \ + libffi-devel \ + ca-certificates \