2011-11-02 00:11:04 +00:00
|
|
|
DEPENDS += "shared-mime-info-native shared-mime-info"
|
|
|
|
|
2011-11-20 21:09:23 +00:00
|
|
|
EXTRA_OECONF += "--disable-update-mimedb"
|
|
|
|
|
2011-11-02 00:11:04 +00:00
|
|
|
mime_postinst() {
|
|
|
|
if [ "$1" = configure ]; then
|
|
|
|
UPDATEMIMEDB=`which update-mime-database`
|
|
|
|
if [ -x "$UPDATEMIMEDB" ] ; then
|
|
|
|
echo "Updating MIME database... this may take a while."
|
|
|
|
$UPDATEMIMEDB $D${datadir}/mime
|
|
|
|
else
|
|
|
|
echo "Missing update-mime-database, update of mime database failed!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
mime_postrm() {
|
|
|
|
if [ "$1" = remove ] || [ "$1" = upgrade ]; then
|
|
|
|
UPDATEMIMEDB=`which update-mime-database`
|
|
|
|
if [ -x "$UPDATEMIMEDB" ] ; then
|
|
|
|
echo "Updating MIME database... this may take a while."
|
|
|
|
$UPDATEMIMEDB $D${datadir}/mime
|
|
|
|
else
|
|
|
|
echo "Missing update-mime-database, update of mime database failed!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
python populate_packages_append () {
|
2011-11-09 17:29:53 +00:00
|
|
|
import re
|
2011-11-02 00:11:04 +00:00
|
|
|
packages = d.getVar('PACKAGES', True).split()
|
|
|
|
pkgdest = d.getVar('PKGDEST', True)
|
|
|
|
|
|
|
|
for pkg in packages:
|
|
|
|
mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
|
|
|
|
mimes = []
|
|
|
|
mime_re = re.compile(".*\.xml$")
|
|
|
|
if os.path.exists(mime_dir):
|
|
|
|
for f in os.listdir(mime_dir):
|
|
|
|
if mime_re.match(f):
|
|
|
|
mimes.append(f)
|
|
|
|
if mimes:
|
|
|
|
bb.note("adding mime postinst and postrm scripts to %s" % pkg)
|
|
|
|
postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
|
|
|
|
if not postinst:
|
|
|
|
postinst = '#!/bin/sh\n'
|
|
|
|
postinst += d.getVar('mime_postinst', True)
|
|
|
|
d.setVar('pkg_postinst_%s' % pkg, postinst)
|
|
|
|
postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
|
|
|
|
if not postrm:
|
|
|
|
postrm = '#!/bin/sh\n'
|
|
|
|
postrm += d.getVar('mime_postrm', True)
|
|
|
|
d.setVar('pkg_postrm_%s' % pkg, postrm)
|
|
|
|
bb.note("adding shared-mime-info-data dependency to %s" % pkg)
|
mime.bbclass: Fix bracket error.
This fixes the following error:
ERROR: Error executing a python function in ...:
AttributeError: 'str' object has no attribute 'append'
ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR: File "populate_packages", line 193, in <module>
ERROR:
ERROR: File "populate_packages", line 189, in populate_packages
ERROR:
ERROR: The code that was being executed was:
ERROR: 0189: rdepends.append("shared-mime-info-data")
ERROR: 0190: d.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends))
ERROR: 0191:
ERROR: 0192:
ERROR: *** 0193:populate_packages(d)
ERROR: 0194:
ERROR: (file: 'populate_packages', lineno: 193, function: <module>)
ERROR: 0185: postrm += d.getVar('mime_postrm', True)
ERROR: 0186: d.setVar('pkg_postrm_%s' % pkg, postrm)
ERROR: 0187: bb.note("adding shared-mime-info-data dependency to %s" % pkg)
ERROR: 0188: rdepends = explode_deps(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False)) or ""
ERROR: *** 0189: rdepends.append("shared-mime-info-data")
ERROR: 0190: d.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends))
ERROR: 0191:
ERROR: 0192:
ERROR: 0193:populate_packages(d)
(From OE-Core rev: 043abe4e88abb6754909b93129ea162a577aa828)
Signed-off-by: Samuel Stirtzel <s.stirtzel@googlemail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-06 17:03:19 +00:00
|
|
|
rdepends = explode_deps(d.getVar('RDEPENDS_' + pkg, False) or d.getVar('RDEPENDS', False) or "" )
|
2011-11-02 00:11:04 +00:00
|
|
|
rdepends.append("shared-mime-info-data")
|
|
|
|
d.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends))
|
|
|
|
}
|