aboutsummaryrefslogtreecommitdiffstats
path: root/classes/mime.bbclass
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2008-12-04 12:48:51 +0100
committerKoen Kooi <koen@openembedded.org>2008-12-04 12:48:51 +0100
commit0da3848b944c4c4d1353fd199e761f3c8e6220ee (patch)
tree22cb24129a797fb1f28638e5bf2c75399d1e6ebb /classes/mime.bbclass
parent58b7e35080024943abcb068ab8814a179b7ef406 (diff)
downloadopenembedded-0da3848b944c4c4d1353fd199e761f3c8e6220ee.tar.gz
mime.bcclass: automagically add RDEPENDS on package containing freedesktop-mime-info when detecting the need for it
Diffstat (limited to 'classes/mime.bbclass')
-rw-r--r--classes/mime.bbclass18
1 files changed, 10 insertions, 8 deletions
diff --git a/classes/mime.bbclass b/classes/mime.bbclass
index 07d0f9c259..a214c11ec5 100644
--- a/classes/mime.bbclass
+++ b/classes/mime.bbclass
@@ -1,5 +1,4 @@
DEPENDS += "shared-mime-info-native shared-mime-info"
-RDEPENDS += "shared-mime-info"
mime_postinst() {
if [ "$1" = configure ]; then
@@ -39,16 +38,19 @@ python populate_packages_append () {
if mime_re.match(f):
mimes.append(f)
if mimes != []:
- bb.note("adding mime postinst and prerm scripts to %s" % pkg)
+ bb.note("adding mime postinst and postrm scripts to %s" % pkg)
postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
if not postinst:
postinst = '#!/bin/sh\n'
postinst += bb.data.getVar('mime_postinst', d, 1)
bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
- prerm = bb.data.getVar('pkg_prerm_%s' % pkg, d, 1) or bb.data.getVar('pkg_prerm', d, 1)
- if not prerm:
- prerm = '#!/bin/sh\n'
- prerm += bb.data.getVar('mime_prerm', d, 1)
- bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d)
-
+ postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += bb.data.getVar('mime_postrm', d, 1)
+ bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
+ bb.note("adding shared-mime-info dependency to %s" % pkg)
+ rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
+ rdepends.append("freedesktop-mime-info")
+ bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
}