Fix package manager call for RHEL-based distros

Assuming users will be working with latests versions
for RHEL, Centos or Fedora, the requirement for EPEL
repo is not longer needed. This requirement was due
to argparse not being present in standard repos, something
that does not hold anymore.
For this reason, this patch set removes the installation
of the EPEL repo.
On the other hand, this patch set also makes an extra check
to use dnf when this script is run on Fedora. Since Fedora 22
dnf has been the default package manager instead of yum.

Change-Id: I9fcd47a0bf9302506949fa56efb42b77552710f6
Closes-Bug: #1611527
This commit is contained in:
Victoria Martinez de la Cruz 2016-08-12 18:12:58 -03:00 committed by Victoria Martinez de la Cruz
parent 1477ae850a
commit e2e7ef98d8
1 changed files with 4 additions and 4 deletions

View File

@ -176,11 +176,11 @@ if need_required_packages; then
sudo zypper --non-interactive --gpg-auto-import-keys in $package_list
;;
"fedora" | "rhel" | "centos")
if [ ${platform} = "centos" ]; then
# install EPEL repo, in order to install argparse
sudo rpm -Uvh --force http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
if [ ${platform} = "fedora" ]; then
sudo dnf install $package_list -y
else
sudo yum install $package_list -y
fi
sudo yum install $package_list -y
;;
*)
echo -e "Unknown platform '$platform' for installing packages.\nAborting"