From 0da3848b944c4c4d1353fd199e761f3c8e6220ee Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 4 Dec 2008 12:48:51 +0100 Subject: mime.bcclass: automagically add RDEPENDS on package containing freedesktop-mime-info when detecting the need for it --- classes/mime.bbclass | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'classes/mime.bbclass') 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) } -- cgit v1.2.3