RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Two deep flaws with macro expansions

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 19 Dec 2008 - 12:02:06 CET
Message-id: <761BFE68-31E0-45C7-85AD-7BC75B8E401E@mac.com>

On Dec 19, 2008, at 2:38 AM, Ralf S. Engelschall wrote:

> On Thu, Dec 18, 2008, Jeff Johnson wrote:
>
>> [...]
>> OpenPKG is using %{expand: ...}, and that is a lot closer to Doing  
>> the
>> Right Thing than the Mandriva patch, but both accomplish essentially
>> the same goal, adding one more expansion to a parameterized macro
>> argument.
>> [...]
>
> Yes, and initially I even thought this could became horrible, because
> it could be necessary at lots of places. But practice showed that it  
> is
> fully harmless. It required it in just a few places:
>
> | $ wc -l rpmmacros
> |  979 rpmmacros
> | $ grep "%{expand" rpmmacros  | wc -l
> |   25
>
> So, sure, one has to _KNOW_ that %{expand:...} has to be used, but  
> once
> known it is really OK and especially (because of no implicit extra
> expansions) doesn't lead to any surprises at other macro expansion
> places.

The harder issue (for Per Oyvind and Mandriva Cooker) is that the  
macro flaw
has huge consequences because it is in a macro that is used to tag
Release: for every package built that cannot be easily or simply
changed.

Somehow, identifying a better macro definition for Mandriva will have to
be attempted or the patch will be carried around forevermore.

There's another Mandriva patch to change the EVR collating sequence
while doing EVR comparison that is similarly not at all the
right thing to do, but is absolutely necessary to be carried
in rpm to preserve consistent behavior according to expectations.

The second macro flaw, whether %define or %global is used, pops
up from Fedora every 6 months or so, and is discussed/reviewed
for conformance with packaging policies, and I'm almost certain that
noone really knows its a design flaw that is not easily repaired.

73 de Jeff

  • application/pkcs7-signature attachment: smime.p7s
Received on Fri Dec 19 12:03:30 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.