That looks like the correct output to me. Why do you think it doesn't work?
Note that %quote does not add any quotes, the effect is purely internal. Here's
how to make it visible:
```
$ rpm --define '%foo(D:) %{shescape %{**}}' --eval '%foo -D"33 44" argument'
'-D"33' '44"' 'argument'
$ rpm
> With the new ME_QUOTED support added end of last year we could make this work
> correctly. So the question is if we want `%-x**` or not.
Speaking of `ME_QUOTED`: On a somewhat related note, am I doing something wrong
or does `%{quote}` seem to not play nicely with `%{**}`?
```console
$ rpm
Actually, there is a kind of a way to access the values from Lua even now.
%-f* macro has the last definition of the macro. If you pop (ie undefine) it,
you get the one underneath. And with that, you can walk all the values. It wont
work on normal macros as "%undefine -f*" is not permitted, but
But the change that documented it was commit
a5bd7571358c7974da1c909e331525b13dce1264 by Ralf done March 2023
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1903870809
You are receiving this because you are
Just realized %{-f} and %{-f*} explictly documented as being the last
occurence. So yep, we can't change that.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1903868651
You are receiving this because you are subscribed
I know its that way historically, just doubtful of people actually relying on
multivalues being handled that way. But then, I wouldn't know.
Yet another possibility could be letting macros declare the way they want their
arguments, ie "I can handle multiple values, bring em on", just like we
(We might be able to change the behavior of %-f so that it includes all
occurrences, but even that makes me a bit uneasy.)
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1903859438
You are receiving this because you
Historically it has always been just the last occurrence, so I don't think we
can change this.
Regarding the array of values part: we now can deal properly with it because of
ME_QUOTED. But I'm fine if the functionality is only available to lua (but it
currently is not).
--
Reply to this
Like I said before, I'm not convinced this is the way we want to represent the
multivalue case.
Assuming we can technically do this now, is there a reason not to put those
values into the normal -x* macro? It seems to me we can't really break any
significant existing users as we just haven't
I don't think %-x** should repeat the option name, though. It should just be
the arguments, i.e. just like %-x* but with multiple values.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1903806133
You are receiving this
With the new ME_QUOTED support added end of last year we could make this work
correctly. So the question is if we want `%-x**` or not.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1903696713
You are receiving this
@rhabacker
> shows that the quoting is done by the shell and not by getopt itself. The
> conclusion is that something similar must be done before calling getopt in
> rpm to process macro parameters with quotes.
Isn't that `%quote`, like @pmatilai mentioned? Going back to your experiments
@rhabacker pushed 2 commits.
707ea38dcd1fcdb75377c046dac42ae7047a9e32 Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
a1476b8610e42db5c079bd268bf975fd4a1eb6ab Add test case for macro '%-x**'
--
View it on GitHub:
> ... The conclusion is that something similar must be done before calling
> getopt in rpm to process macro parameters with quotes.
There is already a function named
Since `rpm` uses a call to `getopt` to process the command line, I checked the
parameter list with the command line tool `getopt`.
$ getopt -o "D:" -- -D11 -D 22 -D "33" -D "44 55" -D "66 77"
-D '11' -D '22' -D '33' -D '44 55' -D '66 77' --
which gave the expected results (apart from
> @pmatilai what about quoting each argument separately,
I checked how quotes in strings are handled correctly with the changes from
this pull request:
$ ../rpm-build/rpm --define '%foo(D:) %{-D**}' --eval '%foo -D11 -D 22
-D"33" -D"44 55" -D "66 77"argument'
-D11 -D 22 -D"33"
@pmatilai what about quoting each argument separately, or making them available
as a Lua array? IMO any macro this complex should probably be written in Lua.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1565725576
@rhabacker pushed 2 commits.
8a2ce401037701f7ba8b4521e5275bc2e69cbe60 Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
9e24ee6a7feb187425410d7cfc85875bdc5528d0 Add test case for macro '%-x**'
--
View it on GitHub:
Sorry for not responding earlier, we've been busy with 4.19 alpha preparations
and stuff.
The question is whether this is the way we want to address this particular
issue. Separating the arguments by space introduces a new problem as arguments
can legitimately have spaces in them (by using
> Is there anything else that would block the merge? I need this feature to fix
> a problem I am having on
> https://build.opensuse.org/project/show/windows:mingw:win32.
The dbus project has reported a problem in this regard on
https://gitlab.freedesktop.org/dbus/dbus/-/issues/455 for which
Is there anything else that would block the merge? I need this feature to fix a
problem I am having on
https://build.opensuse.org/project/show/windows:mingw:win32.
--
Reply to this email directly or view it on GitHub:
@rhabacker pushed 2 commits.
357226d505af0a27264b5bd44d9487fa7ce41516 Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
352165ced88ea834bb3918af29607263b7b71e69 Add test case for macro '%-x**'
--
View it on GitHub:
@rhabacker pushed 2 commits.
fdddf0e4d5b565fb70fd484f3fe659cebbdf920b Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
e9e72286becc2437bd5e23e3891911eac342c797 Add test case for macro '%-x**'
--
View it on GitHub:
> depends on #2455
Dropped that dependency.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449#issuecomment-1490025786
You are receiving this because you are subscribed to this thread.
Message ID:
@rhabacker pushed 2 commits.
698f348b36a5cacc27b9124d1480689464cbb396 Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
7ea7048c9ba1d800dcace3ea2d4bbec4ab459abe Add test case for macro '%-x**'
--
View it on GitHub:
This pull request required several push forces because the master branch of rpm
on openSUSE 15.4 could not be built due to the missing package rpm-sequoia. The
patch was therefore developed on rpm-4.14.x and ported to the master branch.
--
Reply to this email directly or view it on GitHub:
@rhabacker pushed 5 commits.
c58523210de4b634b88234f62356afacc5f545d9 Add test case for macro '%-x'
9e68081107b48927844cdf41d842b07451296893 Don't let macro '%-x' add extra space
between flag and argument
13ee56a4a4c3260f6c4742729d6b178361d83338 Fix documentation of macro '%-x'
@rhabacker pushed 4 commits.
588fe4e589e93df6c55f2561a4239469a894bb1e Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
9ce95f236aa9b93a2a7f57e0748d7fcaa793dc46 Add test case for macro '%-x**'
c720f1c535f3e9fd3839dbd96a5c2a8a6c0e33ca Fix documentation of macro '%-x'
@rhabacker pushed 4 commits.
55e823552a77d32e091029a3de3b1de7b11583ca Add macro '%-x**' containing all
occurrences of the flag '-x' or '-x '.
e367ec02c4b9225c256539016f46dc3f3fdfb856 Add test case for macro '%-x**'
9c675a153c73e7fd9d168c63a6b0cdd2a1a04856 Fix documentation of macro '%-x'
@rhabacker pushed 2 commits.
b5d78ba8a14541f3a6c5d92139f26dbf6ffc1eb5 Add macro '-x**' containing all
occurrences of the flag '-x' or '-x '.
7bdc64e64f41df099ee2d3920e68e7c90f92a59b Add test case for macro '%-x**'
--
View it on GitHub:
@rhabacker pushed 2 commits.
e5bddc4664cb7aab65089caa6d9da6499326bb78 Add macro '-x**' containing all
occurrences of the flag '-x' or '-x '.
ab8341d28b4b6a896bfddc7a38a45f1af60171d6 Add test case for macro '%-x**'
--
View it on GitHub:
@rhabacker pushed 2 commits.
51c001aea91e99ee860e46fdcd4a96b9ac50304f Add macro '-x**' containing all
occurrences of the flag '-x' or '-x '.
b38f87edc9aa7d76afa83cb6b1b0f0aa2ae51e5d Add test case for macro '%-x**'
--
View it on GitHub:
@rhabacker pushed 2 commits.
b5117ae76f47c3629d56668c272808e066eeabe8 Keep original flag format when
creating the %-x** macro
0273daa43cba6cdd373269df92d8bab2d70693ad Adjust test case for macro '%-x**'
--
View it on GitHub:
@rhabacker pushed 1 commit.
fb9c9ffe57563ce3f5ddca570500108a795be262 Add test case for macro '%-x**'
--
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2449/files/22f16526824374413d50c008e6d4a2285949ac3b..fb9c9ffe57563ce3f5ddca570500108a795be262
You are receiving this
@rhabacker pushed 2 commits.
8b9dbeee09014bf2a6b01f22cb6ed3896bebbd5e Add macro '-x**' containing all
occurrences of the flag '-x'.
22f16526824374413d50c008e6d4a2285949ac3b Add test case for macro '%-x**'
--
View it on GitHub:
Fix #546
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/2449
-- Commit Summary --
* Add macro -x** containing all occurrences of the flag
-x.
-- File Changes --
M docs/manual/macros.md (3)
M rpmio/macro.c (15)
36 matches
Mail list logo