On Feb 1, 2008, at 10:15 AM, Stefan Westmeier wrote:
> Thx !! Works :-)
>
> One observation I made:
>
> in my macros file (/home/user/SWDev/rpmmacros) I define:
>
> %_builddir %{wa_root}
>
> rpmbuild --macros /opt/lib/rpm/macros:/home/user/SWDev/rpmmacros \
> --define 'wa_root /home/user/SWDev' --eval '%
> {_builddir}
> --> /home/user/SWDev
>
> rpmbuild --define 'wa_root /home/user/SWDev' \
> --macros /opt/lib/rpm/macros:/home/user/SWDev/
> rpmmacros --eval '%{_builddir}
> --> /opt/src/rpm/BUILD
>
> Is this a bug or a feature ?
>
There's order implicit in how macros are defined.
I can't tell atm bug <-> feature because of current/recent changes
to macro processing. Its not like rpm's macro handling is defined
in some standard.
Traditionally, rpm attempted initialization -> CLI defines -> spec
file defines
in that order, so I'd say bug. But additional (and useful)
functionality added
for OpenPKG may prevent the traditional goal in rpm-5.0.
You should get deterministic behavior if you add --macro before any
--define.
BTW, there is also a %{load:/path/to/some/macros} primitive that can
be used to read macro definitions from a file.
73 de Jeff
Received on Fri Feb 1 16:28:37 2008