diff --git a/bootstrap/_rpm_common.sh b/bootstrap/_rpm_common.sh index 532969aaf..b1df5810a 100755 --- a/bootstrap/_rpm_common.sh +++ b/bootstrap/_rpm_common.sh @@ -6,35 +6,28 @@ # "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 \ - git-core \ - python \ - python-devel \ - python-virtualenv \ - python-devel \ - gcc \ - dialog \ - augeas-libs \ - openssl-devel \ - libffi-devel \ - ca-certificates \; + yum install -y $pkgs; + elif hash dnf 2>/dev/null; then - dnf install -y \ - git-core \ - python \ - python-devel \ - python-virtualenv \ - python-devel \ - gcc \ - dialog \ - augeas-libs \ - openssl-devel \ - libffi-devel \ - ca-certificates \; + dnf install -y $pkgs; + else echo "Neither yum nor dnf found. Aborting bootstrap!" exit 1; + fi } bootstrap