From 921de80d47d5dceaf7e7376d1644d3277254ca8774e84a0d1f01dc1d64f88dcb Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 23 Oct 2025 11:45:48 +0200 Subject: [PATCH] Convert to libalternatives, bsc#1245883 --- python-pycodestyle.changes | 10 ++++++++++ python-pycodestyle.spec | 19 ++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/python-pycodestyle.changes b/python-pycodestyle.changes index 40a085e..d8df001 100644 --- a/python-pycodestyle.changes +++ b/python-pycodestyle.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Aug 21 16:12:39 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems only + +------------------------------------------------------------------- +Sat Jul 19 07:30:53 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Tue Apr 15 07:56:06 UTC 2025 - Dirk Müller diff --git a/python-pycodestyle.spec b/python-pycodestyle.spec index ec1bd6b..1f0fb58 100644 --- a/python-pycodestyle.spec +++ b/python-pycodestyle.spec @@ -1,7 +1,7 @@ # # spec file for package python-pycodestyle # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,11 @@ # +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif %{?sle15_python_module_pythons} Name: python-pycodestyle Version: 2.13.0 @@ -31,11 +36,16 @@ BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires(post): update-alternatives -Requires(postun): update-alternatives Provides: python-pep8 = %{version} Obsoletes: python-pep8 < %{version} BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif %python_subpackages %description @@ -64,6 +74,9 @@ sed -ri '1s/^#!.*//' pycodestyle.py %postun %python_uninstall_alternative pycodestyle +%pre +%python_libalternatives_reset_alternative pycodestyle + %check %pytest