* [PATCH 0/2] Name rpm package postinstll files with their package names
@ 2013-03-01 10:02 Kang Kai
2013-03-01 10:02 ` [PATCH 1/2] package_rpm.bbclass: add more description for pre/post scriptlets Kang Kai
2013-03-01 10:02 ` [PATCH 2/2] package_rpm.bbclass: name postinst files with package name Kang Kai
0 siblings, 2 replies; 3+ messages in thread
From: Kang Kai @ 2013-03-01 10:02 UTC (permalink / raw)
To: ross.burton; +Cc: Zhenfeng.Zhao, openembedded-core
[YOCTO #3218]
The following changes since commit 0bedc0b80d9b46cbbf4a2c5e120a6aa52cbc7c2e:
sudo : upgrade to 1.8.6p6 (2013-02-28 23:15:52 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib kaikang/name-rpm-postinst
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kaikang/name-rpm-postinst
Kang Kai (2):
package_rpm.bbclass: add more description for pre/post scriptlets
package_rpm.bbclass: name postinst files with package name
meta/classes/package_rpm.bbclass | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] package_rpm.bbclass: add more description for pre/post scriptlets
2013-03-01 10:02 [PATCH 0/2] Name rpm package postinstll files with their package names Kang Kai
@ 2013-03-01 10:02 ` Kang Kai
2013-03-01 10:02 ` [PATCH 2/2] package_rpm.bbclass: name postinst files with package name Kang Kai
1 sibling, 0 replies; 3+ messages in thread
From: Kang Kai @ 2013-03-01 10:02 UTC (permalink / raw)
To: ross.burton; +Cc: Zhenfeng.Zhao, openembedded-core
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(-)
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('')
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] package_rpm.bbclass: name postinst files with package name
2013-03-01 10:02 [PATCH 0/2] Name rpm package postinstll files with their package names Kang Kai
2013-03-01 10:02 ` [PATCH 1/2] package_rpm.bbclass: add more description for pre/post scriptlets Kang Kai
@ 2013-03-01 10:02 ` Kang Kai
1 sibling, 0 replies; 3+ messages in thread
From: Kang Kai @ 2013-03-01 10:02 UTC (permalink / raw)
To: ross.burton; +Cc: Zhenfeng.Zhao, openembedded-core
When create rootfs, some post install scripts need be run on device.
They are saved under directory /etc/rpm-postinst and named with numbers
such as 100, 101 etc.
Update to name the postinst script file with its package name instead of
just number. That may be more easy to debug when there is a error.
[YOCTO #3218]
Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
meta/classes/package_rpm.bbclass | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 99c4d1a..c0ba54d 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -383,12 +383,11 @@ export NATIVE_ROOT=${STAGING_DIR_NATIVE}
\$2 \$1/\$3 \$4
if [ \$? -ne 0 ]; then
mkdir -p \$1/etc/rpm-postinsts
- num=100
- while [ -e \$1/etc/rpm-postinsts/\${num} ]; do num=\$((num + 1)); done
- echo "#!\$2" > \$1/etc/rpm-postinsts/\${num}
- echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${num}
- cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${num}
- chmod +x \$1/etc/rpm-postinsts/\${num}
+ name=\`head -1 \$1/\$3 | cut -d' ' -f 2\`
+ echo "#!\$2" > \$1/etc/rpm-postinsts/\${name}
+ echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${name}
+ cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${name}
+ chmod +x \$1/etc/rpm-postinsts/\${name}
fi
EOF
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-01 10:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 10:02 [PATCH 0/2] Name rpm package postinstll files with their package names Kang Kai
2013-03-01 10:02 ` [PATCH 1/2] package_rpm.bbclass: add more description for pre/post scriptlets Kang Kai
2013-03-01 10:02 ` [PATCH 2/2] package_rpm.bbclass: name postinst files with package name Kang Kai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox