RPM Community Forums

Mailing List Message of <rpm-users>

Re: macro args broken

From: Ralf S. Engelschall <rse+rpm-users@rpm5.org>
Date: Thu 21 Feb 2008 - 07:45:46 CET
Message-ID: <20080221064546.GA74490@engelschall.com>
On Wed, Feb 20, 2008, Elan Ruusamäe wrote:

> ~/.rpmmacros:
>
> %argtest(p:b:a:) %{-b:b=%{-b*}} 1=%1
>
> $ rpm -E "%argtest -p 1 -b 2 param1 param2"
> b=2 1=param1
>
> $ rpm -E "%argtest param1 param2 -p 1 -b 2"
>  1=param1
>
> thus, if parameters are passed before options, the options are not to be seen

Yes, the RPM macro parser uses positional options and does not support
permutations of options and arguments (as it was based on getopt and
because it makes sense for macros anyway). In latest RPM 5.1.DEVEL
it actually uses POPT and could support permutations but I strongly
recommend to keep it running like getopt there as else it would break
lots of macros, I guess.

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Thu Feb 21 07:51:36 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.