Fix setup script for RedHat based linux

Use rpm= packages passed to install with yum.

Recognise yum in check-for-build-tools
This commit is contained in:
Bill Ruddock 2020-04-02 20:37:56 +01:00 committed by Elliot Winkler
parent c6668529db
commit ccd539d726
1 changed files with 10 additions and 6 deletions

View File

@ -88,7 +88,7 @@ install() {
sudo apt-get install -y "$package" sudo apt-get install -y "$package"
fi fi
elif has-executable yum; then elif has-executable yum; then
package="${yum_package:-$default_package}" package="${rpm_package:-$default_package}"
if [[ -n $package ]]; then if [[ -n $package ]]; then
sudo yum install -y "$package" sudo yum install -y "$package"
@ -101,16 +101,20 @@ install() {
check-for-build-tools() { check-for-build-tools() {
if [[ $platform == "linux" ]]; then if [[ $platform == "linux" ]]; then
if ! has-executable apt-get; then if has-executable apt-get; then
# TODO: Check if build-essential is installed on Debian?
true
elif has-executable yum; then
# TODO: Check if 'Development Tools' group is installed on RedHat?
true
else
error "You don't seem to have a package manager installed." error "You don't seem to have a package manager installed."
echo-wrapped "\ echo-wrapped "\
The setup script assumes you're using Debian or a Debian-derived flavor of The setup script assumes you're using Debian, RedHat or a derived flavor of
Linux (i.e. something with Apt). If this is not the case, then we would Linux (i.e. something with Apt or Yum). If this is not the case, then we would
gladly take a PR fixing this!" gladly take a PR fixing this!"
exit 1 exit 1
fi fi
# TODO: Check if build-essential is installed on Debian?
else else
if ! has-executable brew; then if ! has-executable brew; then
error "You don't seem to have Homebrew installed." error "You don't seem to have Homebrew installed."