summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2019-06-26 15:40:21 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-27 12:20:24 +0100
commit52c36dd869c605c0065c17f9ed502a319ce3dd84 (patch)
tree94ef034a5326805ace890d80a9f85b1c5b2a64b1
parent3583b713884ad7ce39f91b072dc22b8c9730eabd (diff)
downloadopenembedded-core-contrib-52c36dd869c605c0065c17f9ed502a319ce3dd84.tar.gz
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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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)