Re: Comments in spec files (was Re: Plan for tomorrows (20070517) FESCO meeting)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 19 May 2007 16:11:15 +0200, Denis Leroy wrote:

> >> # Like this
> >> ## or this in many script languages.
> >>
> >>> I remember a few years ago I was asked to remove all '# comments' 
> >>> lines from scriptlets apparently because they "could cause problems"...
> >>
> >> No. You were only asked to not add such comment lines _after_ scriptlet
> >> sections in the spec file, because the comments would be included in the
> >> scriptlet bodies, even if a scriptlet section is passed to 
> >> /sbin/ldconfig,
> >> which doesn't understand the contents and breaks badly.
> 
> Not enough coffee. You meant "after scriptlet sections ON THE SAME LINE" 
> as in
> 
> %post -p /sbin/ldconfig # bad comment

That one would not even rpmbuild. ;)


Rule of thumb: Avoid comment lines after %post/postun/pre/preun (and likely
also the trigger sections) up to the next non-scriptlet section.

This is what I refer to:


...
%post -p /sbin/ldconfig

# These comment lines are included in the %post script.
# *Everything* up to the following script section is included.
# See: rpm --query --scripts ...
%postun -p /sbin/ldconfig


# And this comment is included in the %postun (!) script and
# breaks ldconfig, too.
%check
...



Note that even if the script sections were executed with default /bin/sh,
comments _before_ a %post/postun/... section would make it into the
previous [and hence wrong] script body.

--
Fedora-maintainers mailing list
Fedora-maintainers@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers

--
Fedora-maintainers-readonly mailing list
Fedora-maintainers-readonly@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers-readonly

[Index of Archives]     [Fedora Users]     [Fedora Development]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux