Skip to content

Commit

Permalink
Merge pull request #20487 from mguetschow/dhcpv6-os
Browse files Browse the repository at this point in the history
dist/tools/dhcpv6-pd_ia: recognize Debian correctly
  • Loading branch information
maribu authored Mar 19, 2024
2 parents 23d30cb + 666d429 commit 0c2601d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dist/tools/dhcpv6-pd_ia/pkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
class PackageManagerFactory(object):
@staticmethod
def _get_linux_distro():
if hasattr(platform, "linux_distribution"):
return platform.linux_distribution()[0]
elif os.path.exists("/etc/os-release"):
if os.path.exists("/etc/os-release"):
with open("/etc/os-release") as f:
for line in f:
m = re.match(r"^NAME=\"(.+)\"$", line)
Expand All @@ -42,7 +40,7 @@ def get_installer(cls):
system = platform.system()
if system == "Linux":
system = cls._get_linux_distro()
if system in ["Debian", "Ubuntu", "Linux Mint"]:
if system.startswith(("Debian", "Ubuntu", "Linux Mint")):
return Apt("Debian")
if system in ["Arch Linux"]:
return PacMan("Arch")
Expand Down

0 comments on commit 0c2601d

Please sign in to comment.