[Rpm-maint] [rpm-software-management/rpm] Fix a %buildroot regression on an early %__spec_install_pre %global o… (PR #3137)
Panu Matilainen
notifications at github.com
Fri May 31 09:06:54 UTC 2024
…verride
The Fedora kernel.spec overrides %__spec_install_pre with this very early in the spec:
%global __spec_install_pre %{___build_pre}
This happens long before Name and all that is defined, so half of the environment setup in %___build_pre just falls through with unexpanded macros as the values (eg RPM_PACKAGE_NAME=%{NAME}) at this stage, and get their real values on the re-expansion before the actual scriptlet execution. But, due to pre-historical reasons, RPM_BUILD_ROOT setting is conditional, depending on whether %buildroot is defined or not. It used to be defined in the main macros file, so RPM_BUILD_ROOT would also get that template-style value at this point in the spec, but since 9d35c8df497534e1fbd806a4dc78802bcf35d7cb it no longer is. And that causes RPM_BUILD_ROOT to be *dropped* from the pre-environment "template" at this early stage of spec parsing.
Add a simple reproducer test, this level of meddling in packages is of playing with fire and we may not be able to guarantee it always stays this way, but at least we'll be aware of possible changes in behavior.
Commit 0a4e182e4003be1497452658b7b3327975694641 from 1998 is the first macro version of this conditional that came back to bite us.
Reported in https://bugzilla.redhat.com/show_bug.cgi?id=2284036
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/3137
-- Commit Summary --
* Fix a %buildroot regression on an early %__spec_install_pre %global override
-- File Changes --
M macros.in (4)
A tests/data/SPECS/install-hack.spec (20)
M tests/rpmbuild.at (12)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/3137.patch
https://github.com/rpm-software-management/rpm/pull/3137.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3137
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3137 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240531/3dcf3a17/attachment.html>
More information about the Rpm-maint
mailing list