From 93f43db654543b4e3f540fe014ac4e6036778bd1 Mon Sep 17 00:00:00 2001 From: Patrick Heppler Date: Mon, 10 Aug 2015 13:53:29 +0200 Subject: [PATCH 1/5] Update _rpm_common.sh Added switch to use either yum or dnf (fedora 22) --- bootstrap/_rpm_common.sh | 45 +++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/bootstrap/_rpm_common.sh b/bootstrap/_rpm_common.sh index 398cfe315..532969aaf 100755 --- a/bootstrap/_rpm_common.sh +++ b/bootstrap/_rpm_common.sh @@ -5,15 +5,36 @@ # - Centos 7 (x64: on AWS EC2 t2.micro, DigitalOcean droplet) # "git-core" seems to be an alias for "git" in CentOS 7 (yum search fails) -yum install -y \ - git-core \ - python \ - python-devel \ - python-virtualenv \ - python-devel \ - gcc \ - dialog \ - augeas-libs \ - openssl-devel \ - libffi-devel \ - ca-certificates \ +bootstrap() { + 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 \; + 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 \; + else + echo "Neither yum nor dnf found. Aborting bootstrap!" + exit 1; + fi +} +bootstrap From aa0407b39fc5530d95c3c1993f5f488b28bc8fcf Mon Sep 17 00:00:00 2001 From: Patrick Heppler Date: Fri, 14 Aug 2015 12:20:03 +0200 Subject: [PATCH 2/5] Update _rpm_common.sh --- bootstrap/_rpm_common.sh | 41 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 24 deletions(-) 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 From 84d9c773a2727c6702871f7251bbdad53c6972be Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 5 Sep 2015 17:38:11 +0000 Subject: [PATCH 3/5] #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 \ From eace5d1161f8f0a44486aea0ca2a4a27744e8e7e Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 5 Sep 2015 18:04:57 +0000 Subject: [PATCH 4/5] shell: add missing "fi" --- bootstrap/_rpm_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap/_rpm_common.sh b/bootstrap/_rpm_common.sh index 2db1c7cfa..82f4bb8f1 100755 --- a/bootstrap/_rpm_common.sh +++ b/bootstrap/_rpm_common.sh @@ -13,6 +13,7 @@ then else echo "Neither yum nor dnf found. Aborting bootstrap!" exit 1 +fi # "git-core" seems to be an alias for "git" in CentOS 7 (yum search fails) $tool install -y \ From 0978441392fb52472b092c2eb342436cb6c7d611 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 5 Sep 2015 18:28:27 +0000 Subject: [PATCH 5/5] fix indent --- bootstrap/_rpm_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap/_rpm_common.sh b/bootstrap/_rpm_common.sh index 82f4bb8f1..3fd0f59f9 100755 --- a/bootstrap/_rpm_common.sh +++ b/bootstrap/_rpm_common.sh @@ -6,13 +6,13 @@ if type yum 2>/dev/null then - tool=yum + tool=yum elif type dnf 2>/dev/null then - tool=dnf + tool=dnf else - echo "Neither yum nor dnf found. Aborting bootstrap!" - exit 1 + echo "Neither yum nor dnf found. Aborting bootstrap!" + exit 1 fi # "git-core" seems to be an alias for "git" in CentOS 7 (yum search fails)