[Fedora-packaging] Are brackets around macros required?

Toshio Kuratomi a.badger at gmail.com
Tue Aug 16 06:35:03 UTC 2011


On Mon, Aug 15, 2011 at 12:12:24PM -0500, Rex Dieter wrote:
> On 08/15/2011 12:02 PM, Göran Uddeborg wrote:
> > In a package review recently I was asked to put brackets around all
> > macro usages.  That is, writing
> >    %{name}.desktop
> > rather than
> >    %name.desktop
> 
> imho, using brackets is near-universally safer, but I doubt we need to 
> mandate it.  If anyone's non-use of brackets ever does break anything, 
> that's their responsibility to fix I suppose.
> 
To expand on this, just like shell, you can get into trouble if you write
something like (contrived example):
Source0: %namer%version.tar.gz 

But earlier in the spec file (or from one of rpmn's system-wide configs):

%define namer foo

One counter example is when the macro is itself a little script
that needs to take arguments.  In that case rpmbuild will hand the arguments
to the macro when you do not use the curly braces but won't when you do
(unless you include the arguments inside of the curly braces).  See
%py_byte_compile for an example of this.

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/packaging/attachments/20110815/cf2e7884/attachment.bin 


More information about the packaging mailing list