[Fedora-packaging] Are brackets around macros required?

Göran Uddeborg goeran at uddeborg.se
Thu Aug 18 19:57:43 UTC 2011


Tom Callaway:
> %namev%version
> 
> Is the macro %namev? %name? %na?

Michael Schwendt:
> RPM may accept it, but it cannot always parse it correctly either:
> 
>   echo "a=b" > %nameconfig.cfg
> 
> won't do the right thing even with %name being defined by default.

Are you joking?  Or am I missing something?  Of course, it means
%namev and %nameconfig respectively.

Reusing the analogy with the shell, if you in a shell script see the
code

  echo $PATHTYPE

would you be unsure if that meant the value of the variable PATH
followed by the string "TYPE", or if it meant the value of the
variable PATHTYPE?  I don't think you would.

Save for Fortran, in all programming languages I can recall the parser
takes the longest sequence of characters that is a valid token to be
the next token from the input.

I don't understand what you find so different in the spec file case.

Tom Callaway:
> It is sloppy form.

Oh, come on!  I understand you prefer the style with brackets.  And
your opinion certainly has much more weight than mine in Fedora.

I do have a different preference.  Not because I am sloppy and wish to
type a few characters less.  Because I do find it easier to read
without brackets that don't carry any information.

I find that accusation unfair.


More information about the packaging mailing list