From 24643ed603082b5637c4c93bea907a63ed9115f2ff36116672918f1a26ba32eb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 5 Nov 2021 14:12:26 +0000 Subject: [PATCH] Accepting request 923310 from home:schubi2 - Use libalternatives instead of update-alternatives. OBS-URL: https://build.opensuse.org/request/show/923310 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=91 --- python-pip.changes | 5 +++++ python-pip.spec | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/python-pip.changes b/python-pip.changes index dec938b..052159c 100644 --- a/python-pip.changes +++ b/python-pip.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 8 16:07:38 UTC 2021 - Stefan Schubert + +- Use libalternatives instead of update-alternatives. + ------------------------------------------------------------------- Mon Jan 4 08:43:14 UTC 2021 - Paolo Stivanin diff --git a/python-pip.spec b/python-pip.spec index 28b5819..8a8bd8b 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" @@ -47,13 +53,18 @@ Patch0: pip-shipped-requests-cabundle.patch Patch1: remove_mock.patch BuildRequires: %{python_module setuptools >= 40.8.0} BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros >= 20210929 Requires: ca-certificates Requires: coreutils Requires: python-setuptools Requires: python-xml +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif Recommends: ca-certificates-mozilla BuildArch: noarch %if %{with test} @@ -146,6 +157,8 @@ donttest+=" or test_from_link_vcs_without_source_dir" # of the old binary resulting from the non-update-alternatives-ified package: [ -h %{_bindir}/pip ] || rm -f %{_bindir}/pip [ -h %{_bindir}/pip3 ] || rm -f %{_bindir}/pip3 +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pip %if !%{with test} && !%{with wheel} %post