summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-06-17 16:11:11 +0800
committerRobert Yang <liezhi.yang@windriver.com>2019-06-26 15:30:11 +0800
commit7670cc471f807cd801b77532e1480031f4cba8c4 (patch)
treee0e4c040ed884e6ba507fad9665696010f32557f
parent4bb3e8f98e2bbfcb20f1b32d2b7674d1a6cb47be (diff)
downloadopenembedded-core-contrib-7670cc471f807cd801b77532e1480031f4cba8c4.tar.gz
openembedded-core-contrib-7670cc471f807cd801b77532e1480031f4cba8c4.tar.bz2
openembedded-core-contrib-7670cc471f807cd801b77532e1480031f4cba8c4.zip
update-alternatives.bbclass: run update-alternatives firstly in postinst script
Recipes like postfix run command newaliases in postinst, but newaliases is installed as newaliases.postfix, it needs run update-alternatives to update it to newaliases, so there was an error when installed postinst on target. Fixed: $ opkg install postfix Configuring postfix. ///var/lib/opkg/info/postfix.postinst: line 4: newaliases: command not found Run update-alternatives firstly will fix the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/update-alternatives.bbclass7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index b702e77ee5..8c2b66e7f1 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -284,8 +284,11 @@ python populate_packages_updatealternatives () {
bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg)
bb.note('%s' % alt_setup_links)
- postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n'
- postinst += alt_setup_links
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if postinst:
+ postinst = alt_setup_links + postinst
+ else:
+ postinst = '#!/bin/sh\n' + alt_setup_links
d.setVar('pkg_postinst_%s' % pkg, postinst)
bb.note('%s' % alt_remove_links)