[Rpm-maint] [rpm-software-management/rpm] `%global` run twice causing duplicated opts (Discussion #3871)
frenzymadness
notifications at github.com
Mon Jul 28 12:59:49 UTC 2025
I have a simple specfile, and I need to add one flag (`I`) into `%py3_shbang_opts`. `%py3_shbang_opts` is defined in `macros.python3` as `-s` on RHEL 8 and `-sP` on Fedora but that does not matter.
I have the following global at the very beginning of the specfile:
```
%global py3_shbang_opts %{py3_shbang_opts}I
```
and the result I can simply echo in `%prep` is: `sPII`. Why is there the `I` twice? Is the beginning of the specfile interpreted twice?
Interestingly, this happens only if the aforementioned `%global` is called anywhere in the top section of the specfile if at least one tag follows it. It seems like the tags are read and then the whole specfile is read and interpreted for the second time, causing the `I` flag to be added twice.
Is this a known problem?
A workaround is to use `sed` to make sure the `I` is there only once, no matter how many times the definition is called.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3871
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/repo-discussions/3871 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250728/7be18080/attachment.htm>
More information about the Rpm-maint
mailing list