Skip to content

Commit

Permalink
Fix install-eaf.py to also work on Fedora (#841)
Browse files Browse the repository at this point in the history
On some (or all) Fedora installations, the pacman command is available so that
the install-eaf.py currently tries to use the pacman installer (trying to
installing the arch packages defined in the json file). This commit fixes it by
placing Fedora (dnf) before Arch (pacman) in the 'system check'.
  • Loading branch information
dalanicolai authored Sep 1, 2021
1 parent 239d059 commit 9bb51cc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions install-eaf.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ def run_command(command, path=script_path, ensure_pass=True, get_result=False):

def install_sys_deps(distro: str, deps_list):
command = []
if distro == 'pacman':
command = ['sudo', 'pacman', '-Sy', '--noconfirm']
if which("dnf"):
command = ['sudo', 'dnf', '-y', 'install']
elif distro == 'apt':
command = ['sudo', 'apt', '-y', 'install']
elif which("dnf"):
command = ['sudo', 'dnf', '-y', 'install']
elif distro == 'pacman':
command = ['sudo', 'pacman', '-Sy', '--noconfirm']
elif which("pkg"):
command = ['doas', 'pkg', '-y', 'install']
elif which("zypper"):
Expand Down Expand Up @@ -183,14 +183,14 @@ def add_or_update_app(app: str, app_spec_dict):

def get_distro():
distro = ""
if which("pacman"):
if which("dnf"):
distro = "dnf"
elif which("apt"):
distro = "apt"
elif which("pacman"):
distro = "pacman"
if (not args.ignore_core_deps and not args.ignore_sys_deps and len(args.install) == 0) or args.install_core_deps:
run_command(['sudo', 'pacman', '-Sy', '--noconfirm'])
elif which("apt"):
distro = "apt"
elif which("dnf"):
distro = "dnf"
elif which("pkg"):
distro = "pkg"
elif which("zypper"):
Expand Down

0 comments on commit 9bb51cc

Please sign in to comment.