mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 10:52:44 +01:00
dist/tools/dhcpv6-pd_ia: recognize Debian correctly
This commit is contained in:
parent
c5710392b2
commit
666d42971d
6
dist/tools/dhcpv6-pd_ia/pkg/__init__.py
vendored
6
dist/tools/dhcpv6-pd_ia/pkg/__init__.py
vendored
@ -27,9 +27,7 @@ __email__ = "m.lenders@fu-berlin.de"
|
|||||||
class PackageManagerFactory(object):
|
class PackageManagerFactory(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_linux_distro():
|
def _get_linux_distro():
|
||||||
if hasattr(platform, "linux_distribution"):
|
if os.path.exists("/etc/os-release"):
|
||||||
return platform.linux_distribution()[0]
|
|
||||||
elif os.path.exists("/etc/os-release"):
|
|
||||||
with open("/etc/os-release") as f:
|
with open("/etc/os-release") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
m = re.match(r"^NAME=\"(.+)\"$", line)
|
m = re.match(r"^NAME=\"(.+)\"$", line)
|
||||||
@ -42,7 +40,7 @@ class PackageManagerFactory(object):
|
|||||||
system = platform.system()
|
system = platform.system()
|
||||||
if system == "Linux":
|
if system == "Linux":
|
||||||
system = cls._get_linux_distro()
|
system = cls._get_linux_distro()
|
||||||
if system in ["Debian", "Ubuntu", "Linux Mint"]:
|
if system.startswith(("Debian", "Ubuntu", "Linux Mint")):
|
||||||
return Apt("Debian")
|
return Apt("Debian")
|
||||||
if system in ["Arch Linux"]:
|
if system in ["Arch Linux"]:
|
||||||
return PacMan("Arch")
|
return PacMan("Arch")
|
||||||
|
Loading…
Reference in New Issue
Block a user