Spec/macro comments (was: Any new restriction in Koji added recently in Rawhide?)

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

 



On 6/18/19 2:05 PM, Panu Matilainen wrote:
On 6/18/19 10:15 AM, Florian Weimer wrote:
* Panu Matilainen:

Are # lines stripped always, even in scriptlets?


No, because whatever is in scriptlets body belongs to the scriptlet interpreter which certainly is not rpm. Oh, I know...

To that cause, I just submitted https://github.com/rpm-software-management/rpm/pull/753. Doesn't help with comments after %endif though.

Just FWIW, %dnl support is now in rawhide.

What it means in practise is that for the first time there's now a way to escape macro expansion for the rest of the line (so eg multiline macros such as %configure can be commented out with it), it's possible to add comments to macros themselves and comments can appear anywhere in the spec.

The classical example of this is comments intended for the scriptlet below ending up in the previous scriptlet body.
---
%post -p /sbin/ldconfig

%dnl postun is needed to handle foo
%postun
%dnl always do bar first
%{_bindir}/do_bar
%{_bindir}/do_foo
---

...results in:

$ rpm -qp --scripts scriptintr-1.0-1.fc30.noarch.rpm
postinstall program: /sbin/ldconfig
postuninstall scriptlet (using /bin/sh):
/usr/bin/do_bar
/usr/bin/do_foo

...wheras #-comments would end up in the package and in case of "postun is needed to handle foo", in the body of the wrong scriptlet that will cause ldconfig to complain.

	- Panu -
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux