Don't exit from pyproject-srpm-macros implementation of %pyproject_buildrequires

- Fixes: rhbz#2391290

Consider code like this:

    %generate_buildrequires
    mv setup.py{,.ignore}
    %pyproject_buildrequires
    mv setup.py{.ignore,}

When %pyproject_buildrequires exits, the second mv is never executed.
The next round of %generate_buildrequires will then fail.

In fact, there is probably not a good reason to call exit from %pyproject_buildrequires.

From https://src.fedoraproject.org/rpms/libcpuid/pull-request/7

(cherry picked from Fedora commit ea56d1c870)
This commit is contained in:
Miro Hrončok 2025-09-01 13:17:43 +02:00
parent 7f6b8131e3
commit ce3a144bca
2 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@
# this macro will cause the package with the real macro to be installed.
# When macros.pyproject is installed, it overrides this macro.
# Note: This takes arbitrary options, to ease addition of new options to the real macro.
%pyproject_buildrequires(-) echo 'pyproject-rpm-macros' && exit 0
%pyproject_buildrequires(-) echo 'pyproject-rpm-macros'
# Declarative buildsystem, requires RPM 4.20+ to work

View File

@ -14,8 +14,8 @@ License: MIT
# Increment Y and reset Z when new macros or features are added
# Increment Z when this is a bugfix or a cosmetic change
# Dropping support for EOL Fedoras is *not* considered a breaking change
Version: 1.18.3
Release: 2%{?dist}
Version: 1.18.4
Release: 1%{?dist}
# Macro files
Source001: macros.pyproject
@ -191,6 +191,10 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
* Mon Sep 01 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.4-1
- Don't exit from pyproject-srpm-macros implementation of %%pyproject_buildrequires
- Fixes: rhbz#2391290
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild