diff --git a/rpm_spec/core-dom0-linux.spec.in b/rpm_spec/core-dom0-linux.spec.in index ab0a749..805c578 100644 --- a/rpm_spec/core-dom0-linux.spec.in +++ b/rpm_spec/core-dom0-linux.spec.in @@ -48,6 +48,7 @@ Requires: qubes-core-admin-client Requires: qubes-utils >= 3.1.3 Requires: qubes-utils-libs >= 4.0.16 Requires: qubes-rpm-oxide +Requires: python3-packaging Conflicts: qubes-core-dom0 < 4.0.23 Requires: %{name}-kernel-install Requires: xdotool diff --git a/vmupdate/agent/source/plugins/manage_rpm_macro.py b/vmupdate/agent/source/plugins/manage_rpm_macro.py index a080669..d784839 100644 --- a/vmupdate/agent/source/plugins/manage_rpm_macro.py +++ b/vmupdate/agent/source/plugins/manage_rpm_macro.py @@ -21,7 +21,7 @@ import os -import pkg_resources +import packaging def manage_rpm_macro(os_data, log, **kwargs): @@ -31,7 +31,7 @@ def manage_rpm_macro(os_data, log, **kwargs): if os_data["os_family"] == "RedHat": rpm_macro = "/usr/lib/rpm/macros.d/macros.qubes" if (os_data["id"] == "fedora" - and os_data["release"] < pkg_resources.parse_version("33")): + and os_data["release"] < packaging.version.parse("33")): log.info("Old fedora version detected.") with open(rpm_macro, "w") as file: file.write("# CVE-2021-20271 mitigation\n" diff --git a/vmupdate/agent/source/plugins/updatesproxy_fix.py b/vmupdate/agent/source/plugins/updatesproxy_fix.py index 6a4f2b8..74f387a 100644 --- a/vmupdate/agent/source/plugins/updatesproxy_fix.py +++ b/vmupdate/agent/source/plugins/updatesproxy_fix.py @@ -22,7 +22,6 @@ import os import pathlib -import pkg_resources def updatesproxy_fix(os_data, log, **kwargs): diff --git a/vmupdate/agent/source/utils.py b/vmupdate/agent/source/utils.py index d267b45..9778bab 100644 --- a/vmupdate/agent/source/utils.py +++ b/vmupdate/agent/source/utils.py @@ -23,7 +23,7 @@ import ast from typing import Optional, Dict, Any -import pkg_resources +import packaging def get_os_data(logger: Optional = None) -> Dict[str, Any]: @@ -49,7 +49,7 @@ def get_os_data(logger: Optional = None) -> Dict[str, Any]: data["name"] = os_release.get("NAME", "Linux").strip() if "VERSION_ID" in os_release: release = os_release["VERSION_ID"] - data["release"] = pkg_resources.parse_version(release) + data["release"] = packaging.version.parse(release) if "VERSION_CODENAME" in os_release: data["codename"] = os_release["VERSION_CODENAME"]