From af6f836337de99c99d48d61c5955d6ec99c8f77dc0bea0d29a40bd72387783a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 11 Aug 2025 12:09:41 +0000 Subject: [PATCH] - Make the libalternatives transition conditional OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argcomplete?expand=0&rev=96 --- python-argcomplete.changes | 5 +++++ python-argcomplete.spec | 26 ++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/python-argcomplete.changes b/python-argcomplete.changes index d5df612..96dd066 100644 --- a/python-argcomplete.changes +++ b/python-argcomplete.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 11 12:08:58 UTC 2025 - Markéta Machová + +- Make the libalternatives transition conditional + ------------------------------------------------------------------- Sat Jul 12 17:20:18 UTC 2025 - Dirk Müller diff --git a/python-argcomplete.spec b/python-argcomplete.spec index 28ff89a..6384daa 100644 --- a/python-argcomplete.spec +++ b/python-argcomplete.spec @@ -25,7 +25,11 @@ %define psuffix %{nil} %bcond_with test %endif +%if 0%{?suse_version} > 1500 %bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-argcomplete%{psuffix} Version: 3.6.2 @@ -40,11 +44,16 @@ BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 67.2} BuildRequires: %{python_module setuptools_scm >= 6.2} BuildRequires: %{python_module wheel} -BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: alts BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %if %{with test} BuildRequires: %{python_module argcomplete == %{version}} BuildRequires: %{python_module pexpect} @@ -100,10 +109,23 @@ export TERM=xterm-mono %endif %if %{without test} +%if %{with libalternatives} %pre %python_libalternatives_reset_alternative activate-global-python-argcomplete %python_libalternatives_reset_alternative register-python-argcomplete %python_libalternatives_reset_alternative python-argcomplete-check-easy-install-script +%else + +%post +%python_install_alternative activate-global-python-argcomplete +%python_install_alternative register-python-argcomplete +%python_install_alternative python-argcomplete-check-easy-install-script + +%pre +%python_uninstall_alternative activate-global-python-argcomplete +%python_uninstall_alternative register-python-argcomplete +%python_uninstall_alternative python-argcomplete-check-easy-install-script +%endif %files %{python_files} %doc README.rst