From b9035188a5d68e031d5a3a6402dc096c17e4673ecff4107b93bd02629435412a Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 15 Jan 2025 10:38:37 +0000 Subject: [PATCH] - Use libalternatives instead of update-alternatives, bsc#1235781 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-charset-normalizer?expand=0&rev=51 --- python-charset-normalizer.changes | 5 +++++ python-charset-normalizer.spec | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/python-charset-normalizer.changes b/python-charset-normalizer.changes index 4d09ab4..8311ca5 100644 --- a/python-charset-normalizer.changes +++ b/python-charset-normalizer.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 15 10:26:52 UTC 2025 - Daniel Garcia + +- Use libalternatives instead of update-alternatives, bsc#1235781 + ------------------------------------------------------------------- Thu Jan 9 09:05:30 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-charset-normalizer.spec b/python-charset-normalizer.spec index de319cc..e9cf096 100644 --- a/python-charset-normalizer.spec +++ b/python-charset-normalizer.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?sle15_python_module_pythons} Name: python-charset-normalizer Version: 3.4.1 @@ -30,8 +36,13 @@ BuildRequires: %{python_module setuptools} 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 Suggests: python-unicodedata2 BuildArch: noarch # SECTION test requirements @@ -56,6 +67,10 @@ Python Universal Charset detector. %check %pytest +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative normalizer + %post %python_install_alternative normalizer