RPM Community Forums

Mailing List Message of <rpm-users>

Re: macro args broken

From: Ralf S. Engelschall <rse+rpm-users@rpm5.org>
Date: Tue 26 Feb 2008 - 18:47:10 CET
Message-ID: <20080226174710.GA64464@engelschall.com>
On Tue, Feb 26, 2008, Jeff Johnson wrote:

> On Feb 26, 2008, at 7:22 AM, Arkadiusz Miskiewicz wrote:
>>
>> 4.4.9 is working fine so count this one as regreesion.
>
> I'll count as an RFE. The flaw that was fixed has been there for ever.
>
> (aside) It would be easy to have it both ways if the getopt(3)
> POSIXLY_CORRECT envvar was a viable mechanism was acutally a viable
> way to control getopt(3) behavior. Setting/removing an envvar to
> control library functionality is the only means known atm to control
> getopt(3) behavior.

Yes, the problem is that getopt(3), as defined by POSIX, does not
support option/argument permutations, but the Linux getopt(3)
implementation by default supports it. This way RPM behaved differently
on different platforms and on Linux the by default enabled support for
permutations caused great trouble:

| $ rpm --define '%foo() <%*>' --eval '%{foo bar %(echo -n "quux") baz}'
| foo: invalid option -- n
| error: Unknown option ? in foo()

But even if this trouble would not be caused, it is nasty that
RPM behaved differently on Linux. So, that one was able to use
option/argument permutations was more or less by accident as the
getopt(3) is less standard than expected by default. On all other
platforms RPM never really supported the permutations, including RPM
4.4.9! It worked just for RPM 4.4.9 under Linux...

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Tue Feb 26 18:51:43 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.