From 471e770ef893a95c0cf672e274d73936d86aca6d2c866a9f7754c526fb55ac53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 26 Mar 2025 13:09:13 +0000 Subject: [PATCH] Accepting request 1256223 from home:nkrapp:branches:devel:languages:python - Use libalternatives instead of update-alternatives, bsc#1240096 OBS-URL: https://build.opensuse.org/request/show/1256223 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-linux-procfs?expand=0&rev=14 --- python-linux-procfs.changes | 5 +++++ python-linux-procfs.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-linux-procfs.changes b/python-linux-procfs.changes index 50f3212..b1423cb 100644 --- a/python-linux-procfs.changes +++ b/python-linux-procfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Mar 26 12:30:06 UTC 2025 - Nico Krapp + +- Use libalternatives instead of update-alternatives, bsc#1240096 + ------------------------------------------------------------------- Wed Jan 29 00:41:51 UTC 2025 - Steve Kowalik diff --git a/python-linux-procfs.spec b/python-linux-procfs.spec index fc4c219..6ca62db 100644 --- a/python-linux-procfs.spec +++ b/python-linux-procfs.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + Name: python-linux-procfs Version: 0.7.3 Release: 0 @@ -29,8 +35,13 @@ BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-six +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -38,7 +49,7 @@ BuildArch: noarch Abstractions to extract information from the Linux kernel /proc files. %prep -%setup -q +%autosetup -p1 %build %pyproject_wheel @@ -51,6 +62,10 @@ Abstractions to extract information from the Linux kernel /proc files. %check %python_exec bitmasklist_test.py +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pflags + %post %python_install_alternative pflags