From fa5102583f0e59d73f3cc49ca86c115e85c34d3765efde97bbdfc06098f7bfcd Mon Sep 17 00:00:00 2001 From: Ana Guerrero Date: Thu, 30 Jan 2025 13:49:19 +0000 Subject: [PATCH] Accepting request 1241241 from devel:languages:python OBS-URL: https://build.opensuse.org/request/show/1241241 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-distro?expand=0&rev=22 --- python-distro.changes | 5 +++++ python-distro.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-distro.changes b/python-distro.changes index ba2af3f..75a24ed 100644 --- a/python-distro.changes +++ b/python-distro.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 24 12:35:25 UTC 2025 - Nico Krapp + +- Use libalternatives instead of update-alternatives, bsc#1235785 + ------------------------------------------------------------------- Fri Feb 23 00:52:41 UTC 2024 - Steve Kowalik diff --git a/python-distro.spec b/python-distro.spec index f46a99f..d8b18a7 100644 --- a/python-distro.spec +++ b/python-distro.spec @@ -1,7 +1,7 @@ # # spec file for package python-distro # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?sle15_python_module_pythons} %{!?license: %global license %doc} %bcond_without test @@ -24,15 +30,20 @@ Version: 1.9.0 Release: 0 Summary: Linux Distribution - a Linux OS platform information API License: Apache-2.0 -URL: https://github.com/nir0s/distro +URL: https://github.com/python-distro/distro Source: https://files.pythonhosted.org/packages/source/d/distro/distro-%{version}.tar.gz Patch0: assert_locale.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif BuildArch: noarch # SECTION test %if %{with test} @@ -65,6 +76,10 @@ export LANG=C.UTF-8 %pytest %endif +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative distro + %post %python_install_alternative distro