Can now install on the opensuse distribution.

- Now using the distro module to determine the linux distro.
This commit is contained in:
Andrew Hamilton 2017-05-31 19:41:56 +01:00
parent 3eb2f71adb
commit 8b867bb333
4 changed files with 87 additions and 40 deletions

View file

@ -1,12 +1,12 @@
#!/usr/bin/env python3
import platform
import distro
import subprocess
import tools
dist_id = platform.linux_distribution()[0].lower()
dist_id = distro.id()
pip_deps, pip3_deps, dist_deps = set(), set(), set()
for dependency in tools.dependencies(dist_id):
if "/" in dependency:
@ -17,7 +17,8 @@ for dependency in tools.dependencies(dist_id):
cmd_for_dist = {"ubuntu": ["apt-get", "-y", "install"],
"debian": ["apt-get", "-y", "install"],
"fedora": ["dnf", "-y", "install"],
"arch": ["pacman", "-S", "--noconfirm", "--needed"]}
"arch": ["pacman", "-S", "--noconfirm", "--needed"],
"opensuse": ["zypper", "-n", "install"]}
if pip_deps:
dist_deps.add("python2-pip" if dist_id == "arch" else "python-pip")
if pip3_deps: