]> code.ossystems Code Review - openembedded-core.git/commitdiff
update-alternatives.bbclass: Add missing runtime dependency
authorMark Hatle <mark.hatle@windriver.com>
Thu, 6 Dec 2012 20:51:13 +0000 (14:51 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Dec 2012 16:07:58 +0000 (16:07 +0000)
When using update-alternatives, there should be a runtime dependency on
${VIRTUAL-RUNTIME_update-alternatives}.  Without this, it's possible to
get into a situation where the package is not installable.

(If VIRTUAL-RUNTIME_update-alternatives is not defined, no requirement
is added.)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/update-alternatives.bbclass

index 4e1ff270523812e0b32036d4df5f9af8db8cc868..a3631eca7e9eb3fe54f231e626b10508826e0c22 100644 (file)
@@ -304,6 +304,12 @@ python populate_packages_prepend () {
             alt_remove_links += '\tupdate-alternatives --remove  %s %s\n' % (alt_name, alt_target)
 
         if alt_setup_links:
+            # RDEPENDS setup
+            provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives', True)
+            if provider:
+                #bb.note('adding runtime requirement for update-alternatives for %s' % pkg)
+                d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX') + provider)
+
             bb.note('adding update-alternatives calls to postinst/postrm for %s' % pkg)
             bb.note('%s' % alt_setup_links)
             postinst = (d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)) or '#!/bin/sh\n'