Patchwork [1/2] package_rpm.bbclass: add more description for pre/post scriptlets

login
register
mail settings
Submitter Kang Kai
Date March 1, 2013, 10:02 a.m.
Message ID <2e3619405410954ad2677d905217ae92254be40b.1362123438.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/45347/
State Accepted
Commit 8506e4f454231a58985e05a11d47dd4556e90bc3
Headers show

Comments

Kang Kai - March 1, 2013, 10:02 a.m.
When write rpm spec file, one description line

"# pkgname - script_type"

is added to pre/post scriptlets for base package but no such line
writted for subpackage.

Add similiar line to subpackage to facilitate handling the pre/post
scriptlets.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 meta/classes/package_rpm.bbclass |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 7a1da33..99c4d1a 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -778,19 +778,23 @@  python write_specfile () {
         # Now process scriptlets
         if splitrpreinst:
             spec_scriptlets_bottom.append('%%pre -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - preinst' % splitname)
             spec_scriptlets_bottom.append(splitrpreinst)
             spec_scriptlets_bottom.append('')
         if splitrpostinst:
             spec_scriptlets_bottom.append('%%post -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - postinst' % splitname)
             spec_scriptlets_bottom.append(splitrpostinst)
             spec_scriptlets_bottom.append('')
         if splitrprerm:
             spec_scriptlets_bottom.append('%%preun -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - prerm' % splitname)
             scriptvar = wrap_uninstall(splitrprerm)
             spec_scriptlets_bottom.append(scriptvar)
             spec_scriptlets_bottom.append('')
         if splitrpostrm:
             spec_scriptlets_bottom.append('%%postun -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - postrm' % splitname)
             scriptvar = wrap_uninstall(splitrpostrm)
             spec_scriptlets_bottom.append(scriptvar)
             spec_scriptlets_bottom.append('')