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

RFE: access to multiple instances of the same option #546

Open
nim-nim opened this issue Sep 21, 2018 · 1 comment · May be fixed by #2449
Open

RFE: access to multiple instances of the same option #546

nim-nim opened this issue Sep 21, 2018 · 1 comment · May be fixed by #2449
Labels

Comments

@nim-nim
Copy link

nim-nim commented Sep 21, 2018

many commands nowadays accept multiple instances of the same flag (for example dnf can take several -x flags with different values)

when you write a macro that calls such a command you want to use the same syntax and have %{?-x} output all the -x flags

unfortunately rpm "helpfully" shortens %{?-x} to just the last one

since changing this would probably break compatibility somewhere, please add a %{?-x**} shorthand meaning all the -x flags with their values

For example, you want to make use of fcommand, that does not understand the v flag, and requires several -f flags, in a macro that already uses vcommand with a v argument

The typical macro use would be

%mymacro -v something -f value1 -f value2

Currently, if you write it this way:

%mymacro(v:f:) %{expand:
vcommand %{?-v}
fcommand %{?-f}
}

rpm will eat -f value1 or -f value2

It should be possible to write

%mymacro(v:f:) %{expand:
vcommand %{?-v}
fcommand  %{?-f**}
}

with %{?-f**} containing -f value1 -f value2, not just one of them

@pmatilai
Copy link
Member

Clearly there's room for improvement wrt repeated arguments but details are less obvious.

@pmatilai pmatilai added this to To do in Lua integration Mar 30, 2020
@pmatilai pmatilai removed this from Maybe in Ticket Review (Outdated) Mar 30, 2020
@pmatilai pmatilai changed the title RFE: access to multivalued flags RFE: access to multiple instances of the same option Mar 23, 2023
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 23, 2023
The flags and arguments added to this macro are separated by spaces.

For example, if the macro argument is '-Dxxx', '-D yyy' and
'-D aaa=bbb', the body of the generated macro %{-D**} will
consist of: '-D xxx -D yyy -D aaa=bbb'.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 23, 2023
The flags and arguments added to this macro are separated by spaces.

For example, if the macro argument is '-Dxxx', '-D yyy' and
'-D aaa=bbb', the body of the generated macro %{-D**} will
consist of: '-D xxx -D yyy -D aaa=bbb'.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 24, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 24, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 24, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 24, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 30, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Mar 30, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Apr 17, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue May 26, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Jun 8, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
rhabacker added a commit to rhabacker/rpm that referenced this issue Oct 11, 2023
… '-x <arg>'.

Flags are added to this macro with the flag and argument
in the original notation and separated from previous by spaces.

Fix rpm-software-management#546
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants