[Rpm-maint] [PATCH] forbid #%define
Per Øyvind Karlsen
pkarlsen at rpm5.org
Fri Jun 6 09:25:02 UTC 2008
2008/6/6 Manfred Hollstein <mh at novell.com>:
> On Fri, 06 Jun 2008, 11:00:00 +0200, Panu Matilainen wrote:
> > [...]
> > This sounds like a no-brainer - why should anything be done for comment
> > lines? But consider the following spec snippet:
> >
> > %build
> > cat << EOF > example.conf
> > # To enable feature foo, uncomment the following:
> > #[myplugin]
> > #pluginpath = %{_libdir}/%{name}/myplugin.so
> > EOF
> >
> > In this case, you'd actually want the macros to be expanded, despite
> being
> > apparently being commented out. Of course the comment markers here aren't
> > intended for the spec parser at all, but how would the parser know that?
> > OTOH, if you take something like
> >
> > %build
> > <...>
> > #%define testing 1
> > %if %{?testing}
> > cat << EOF > README
> > This is just a test build
> > EOF
> > %endif
> >
> > ...you do NOT want the %define to take effect.
>
> Hmm, yes, did not think about this.
>
> > [...]
> > Simple and stupid quick hack of a patch to do that attached, might not be
> > entirely correct for every possible case but seems to do what intended
> for
> > the cases I tested. This would, by the way of spec conventions, take care
> > of the typical problem cases like
> > #%define some thing
> >
> > If you *really* want that define to take place despite being commented,
> > just write
> > #%{define} some thing
> >
> > Thoughts?
>
> Sounds reasonable to me.
>
> > - Panu -
>
> Cheers.
>
> l8er
> manfred
> _______________________________________________
> Rpm-maint mailing list
> Rpm-maint at lists.rpm.org
> https://lists.rpm.org/mailman/listinfo/rpm-maint
>
Sorry for justr barging in on the thread, I'm writing from my gmail account
now and didn't get the chance to read the thread.
But I find it silly to add extra complexity to comment out macros with a
'#', when they can already be commented out with an extra '%' which is well
documented.
So for what gain would it be? Near zero for anyone except for novice
packagers, while giving headaches for people relying on old behaviour..
My 2 cents..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rpm.org/pipermail/rpm-maint/attachments/20080606/0dad5e8a/attachment-0001.htm
More information about the Rpm-maint
mailing list