Description of problem: The %* macro evaluates with leading whitespace. Since the leading whitespace should not be considered part of the arguments to the macro, this IMHO wrong. Where it becomes problematic is when you are quoting the results of %*, as the command receiving this will have an unexpected (unless you are aware of the bug) space at the begining of the argument. Can be worked around, but its just a tad annoying. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Create macro in /etc/rpm/macros like this: %macroX(p:) \ echo "'%{-p:-p=%{-p*}}' '%{*}'" \ %{nil} 2. Use the macro in, say a %post, like this: %macroX -p stuff hello there Actual results: It will evaluate to: echo "'-p=stuff' ' hello there'" And when executed display: '-p=stuff' ' hello there' Expected results: That it would evaluate to: echo "'-p=stuff' 'hello there'" And when executed display: '-p=stuff' 'hello there' Additional info: Will probabably fix this my self. Just wanted a place holder in bugzilla.
Once I found it, it was a trivial fix: Index: macro.c =================================================================== RCS file: /cvs/devel/rpm/rpmio/macro.c,v retrieving revision 2.100 diff -r2.100 macro.c 1013c1013 < *be++ = ' '; --- > if(be != b) *be++ = ' '; /* Add space between args */ I have tested this in 4.2. I want to build it in the head (this diff is from the head) and make sure no obvious borkage is there, and then I will commit. Basically, it was adding a space in front of every argument including the first. The patch makes it not do that on the first argument (you know I have written this same bug in perl, shell and every language I can think of (-;). Cheers...james P.S. I also found that there is this thing called %**. It by the way does not have the leading space. The comment talks about what the args looked like before macro processing, but macro processing seems to have happened on the result of %** so I really don't know what it is about.
I have tested this in the head and commited it....james
Thanks for the patch.