diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-28 10:54:09 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-28 10:54:09 +0000 |
commit | 3e690338421a6b64f6f44aa03db7416d75e0633a (patch) | |
tree | cb3907b4dfbc040edc539fd00645e851b14084bb /sys-libs/libblockdev/files | |
parent | a6f8a4117d60ec2919f9b312dcb0b7baa6c58ab9 (diff) |
gentoo auto-resync : 28:11:2023 - 10:54:09
Diffstat (limited to 'sys-libs/libblockdev/files')
-rw-r--r-- | sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch b/sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch new file mode 100644 index 000000000000..5625478c6081 --- /dev/null +++ b/sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch @@ -0,0 +1,30 @@ +From ec8cab726abe60ba5c7ffcce07905b29c5376163 Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <parona@protonmail.com> +Date: Mon, 13 Nov 2023 16:21:44 +0200 +Subject: [PATCH] Add non-systemd method to get distro name and version + +--- a/tests/utils.py ++++ b/tests/utils.py +@@ -514,10 +514,16 @@ def get_version(): + """ Try to get distro and version + """ + +- bus = dbus.SystemBus() ++ try: ++ bus = dbus.SystemBus() ++ ++ # get information about the distribution from systemd (hostname1) ++ sys_info = bus.get_object("org.freedesktop.hostname1", "/org/freedesktop/hostname1") ++ except dbus.exceptions.DBusException: ++ import platform ++ info = platform.freedesktop_os_release() ++ return (info["NAME"], info["VERSION_ID"]) + +- # get information about the distribution from systemd (hostname1) +- sys_info = bus.get_object("org.freedesktop.hostname1", "/org/freedesktop/hostname1") + cpe = str(sys_info.Get("org.freedesktop.hostname1", "OperatingSystemCPEName", dbus_interface=dbus.PROPERTIES_IFACE)) + + if cpe: +-- +2.42.1 + |