From 85f94f9a8f3588a00446fdae6640fa15b51242c050b1b804914ce4dbb7e702f9 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 23 Oct 2025 11:43:53 +0200 Subject: [PATCH] Convert to libalternatives, bsc#1245883 --- python-invoke.changes | 10 ++++++++++ python-invoke.spec | 25 +++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/python-invoke.changes b/python-invoke.changes index c57d1e6..ffc4687 100644 --- a/python-invoke.changes +++ b/python-invoke.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Aug 21 08:47:08 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + +------------------------------------------------------------------- +Thu Jul 10 13:21:17 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Thu Oct 19 09:31:17 UTC 2023 - Ondřej Súkup diff --git a/python-invoke.spec b/python-invoke.spec index 6e45af8..6bea80d 100644 --- a/python-invoke.spec +++ b/python-invoke.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-invoke # -# Copyright (c) 2023 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 @@ -24,7 +24,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-invoke%{psuffix} Version: 2.2.0 @@ -44,9 +48,14 @@ BuildRequires: python-rpm-macros Requires: python-PyYAML Requires: python-fluidity-sm Requires: python-lexicon -Requires(post): update-alternatives -Requires(postun):update-alternatives 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 PyYAML} BuildRequires: %{python_module fluidity-sm} @@ -78,6 +87,7 @@ rm -fr invoke/vendor/* %python_clone -a %{buildroot}%{_bindir}/inv %python_clone -a %{buildroot}%{_bindir}/invoke +%python_group_libalternatives inv invoke %endif %if %{with test} @@ -96,11 +106,14 @@ skiptests+=" or may_be_overridden_when_pty_True or uses_execve_for_pty_True or s %endif %post -%{python_install_alternative inv invoke} +%python_install_alternative inv invoke %postun %python_uninstall_alternative inv +%pre +%python_libalternatives_reset_alternative inv + %if !%{with test} %files %{python_files} %license LICENSE