diff options
Diffstat (limited to 'meta/classes/mime.bbclass')
| -rw-r--r-- | meta/classes/mime.bbclass | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/meta/classes/mime.bbclass b/meta/classes/mime.bbclass index 6302747dc1..b669418286 100644 --- a/meta/classes/mime.bbclass +++ b/meta/classes/mime.bbclass | |||
| @@ -29,32 +29,32 @@ fi | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | python populate_packages_append () { | 31 | python populate_packages_append () { |
| 32 | import re | 32 | import re |
| 33 | packages = d.getVar('PACKAGES', True).split() | 33 | packages = d.getVar('PACKAGES', True).split() |
| 34 | pkgdest = d.getVar('PKGDEST', True) | 34 | pkgdest = d.getVar('PKGDEST', True) |
| 35 | 35 | ||
| 36 | for pkg in packages: | 36 | for pkg in packages: |
| 37 | mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg) | 37 | mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg) |
| 38 | mimes = [] | 38 | mimes = [] |
| 39 | mime_re = re.compile(".*\.xml$") | 39 | mime_re = re.compile(".*\.xml$") |
| 40 | if os.path.exists(mime_dir): | 40 | if os.path.exists(mime_dir): |
| 41 | for f in os.listdir(mime_dir): | 41 | for f in os.listdir(mime_dir): |
| 42 | if mime_re.match(f): | 42 | if mime_re.match(f): |
| 43 | mimes.append(f) | 43 | mimes.append(f) |
| 44 | if mimes: | 44 | if mimes: |
| 45 | bb.note("adding mime postinst and postrm scripts to %s" % pkg) | 45 | bb.note("adding mime postinst and postrm scripts to %s" % pkg) |
| 46 | postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) | 46 | postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) |
| 47 | if not postinst: | 47 | if not postinst: |
| 48 | postinst = '#!/bin/sh\n' | 48 | postinst = '#!/bin/sh\n' |
| 49 | postinst += d.getVar('mime_postinst', True) | 49 | postinst += d.getVar('mime_postinst', True) |
| 50 | d.setVar('pkg_postinst_%s' % pkg, postinst) | 50 | d.setVar('pkg_postinst_%s' % pkg, postinst) |
| 51 | postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True) | 51 | postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True) |
| 52 | if not postrm: | 52 | if not postrm: |
| 53 | postrm = '#!/bin/sh\n' | 53 | postrm = '#!/bin/sh\n' |
| 54 | postrm += d.getVar('mime_postrm', True) | 54 | postrm += d.getVar('mime_postrm', True) |
| 55 | d.setVar('pkg_postrm_%s' % pkg, postrm) | 55 | d.setVar('pkg_postrm_%s' % pkg, postrm) |
| 56 | bb.note("adding shared-mime-info-data dependency to %s" % pkg) | 56 | bb.note("adding shared-mime-info-data dependency to %s" % pkg) |
| 57 | rdepends = explode_deps(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "" ) | 57 | rdepends = explode_deps(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "" ) |
| 58 | rdepends.append("shared-mime-info-data") | 58 | rdepends.append("shared-mime-info-data") |
| 59 | d.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends)) | 59 | d.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends)) |
| 60 | } | 60 | } |
