From: Robert Yang Date: Wed, 26 Jun 2019 07:40:21 +0000 (+0800) Subject: update-alternatives.bbclass: run update-alternatives firstly in postinst script X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~14055 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52c36dd869c605c0065c17f9ed502a319ce3dd84;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass index b702e77ee5f..8c2b66e7f15 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)