[oe-commits] [openembedded-core] 11/17: update-alternatives.bbclass: run update-alternatives firstly in postinst script

git at git.openembedded.org git at git.openembedded.org
Wed Jun 26 21:55:48 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e44377346fbd2139cd064944bfac3030926e6630
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Wed Jun 26 15:40:21 2019 +0800

    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 at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/update-alternatives.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index b702e77..8c2b66e 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list