From b67b47d5b0a85fcf10371184446d09eaf014cfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 9 Jul 2019 13:40:59 +0200 Subject: [PATCH] %python_provide: Don't try to obsolete %_isa provides Based on recent changes in 04769fa014fe51d623c5b2e110d36bd73d035839, packagers might want to use: %{?python_provide:%python_provide python2-foo%{?_isa}} ...for backwards compatibility. However the macro adds obsoletes and since RPM 4.15, obsoletes with %{?_isa} are not possible: Only package names are allowed in Obsoletes: Obsoletes: python-foo(x86-64) < ... To allow such usage, %python_provide now only obsoletes if the argument does not end with ")". --- macros.python | 12 +++++++----- python-rpm-macros.spec | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/macros.python b/macros.python index 266f356..0ac2b82 100644 --- a/macros.python +++ b/macros.python @@ -53,11 +53,13 @@ print(string.sub(package,9,string.len(package))) print(" = ") print(vr) - --Obsoleting the previous default python package - print("\\nObsoletes: python-") - print(string.sub(package,9,string.len(package))) - print(" < ") - print(vr) + --Obsoleting the previous default python package (if it doesn't have isa) + if (string.sub(package, "-1") ~= ")") then + print("\\nObsoletes: python-") + print(string.sub(package,9,string.len(package))) + print(" < ") + print(vr) + end elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then --No unversioned provides as python3 is not default elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 170092b..5c11c3b 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 44%{?dist} +Release: 45%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -73,6 +73,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %changelog +* Tue Jul 09 2019 Miro Hrončok - 3-45 +- %%python_provide: Don't try to obsolete %%_isa provides + * Mon Jun 17 2019 Miro Hrončok - 3-44 - Make %%__python /usr/bin/python once again until we are ready