[oe-commits] Koen Kooi : mime.bcclass: automagically add RDEPENDS on package containing freedesktop-mime-info when detecting the need for it

GIT User account git at amethyst.openembedded.net
Thu Dec 4 11:51:11 UTC 2008


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 0da3848b944c4c4d1353fd199e761f3c8e6220ee
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=0da3848b944c4c4d1353fd199e761f3c8e6220ee

Author: Koen Kooi <koen at openembedded.org>
Date:   Thu Dec  4 12:48:51 2008 +0100

mime.bcclass: automagically add RDEPENDS on package containing freedesktop-mime-info when detecting the need for it

---

 classes/mime.bbclass |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/classes/mime.bbclass b/classes/mime.bbclass
index 07d0f9c..a214c11 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)
 }





More information about the Openembedded-commits mailing list