Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No build-in processing for multiple occurrences of an option with the same name #2448

Closed
rhabacker opened this issue Mar 23, 2023 · 1 comment

Comments

@rhabacker
Copy link
Contributor

Attempting to process multiple occurrences of an option with the same name with the available rpm macros always returns the last occurrence of the specified option, as the following example shows:

$ rpm --version
RPM version 4.14.3

$ rpm --define='%_macro(D:) %(echo " option -D: %{-D:%{-D*}}")'  --eval "%_macro -Dxxx=aaa -Dyyy sdsdsd"
 option -D: -Dyyy

An evaluation of the available rpm macros for accessing macro parameters with:

$ rpm --define='%_macro(D:) %(echo -e " name: %0 \\n non-option-count: %# \\n non-option-params: %* \\n all-params: %** \\n option -D: %{-D:%{-D*}}")'  --eval "%_macro -Dxxx=aaa -Dyy sdsdsd"
 name: _macro 
 non-option-count: 1 
 non-option-parameter: sdsdsd 
 all parameters: -Dxxx=aaa -Dyyy -- sdsdsd 
 Option -D: -Dyyy

shows that the requested option is basically available only through %** but requires additional processing to extract the multiple occurrences of the relevant option. It would therefore be helpful if rpm had support for this case.

This case has come up when revising an rpm macro for cmake support at the mingw project on build.opensuse.org, where single options would have to be processed in the macro in question but other options that may occur multiple times would have to be passed to cmake.

@pmatilai
Copy link
Member

Yes, a known limitation, this is duplicate of #546 but before just now it had a strange summary which made it hard to discover (I only found it myself because I knew it was there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants