mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
fix error during post uninstall: %postun(shared-mime-info-data-2.0-r0.4.corei7_64): execv(/bin/sh) pid 78 + '[' 0 = 0 ']' + set -e + '[' x '!=' x ']' + echo 'Updating MIME database... this may take a while.' Updating MIME database... this may take a while. + update-mime-database /usr/share/mime Directory '/usr/share/mime/packages' does not exist! %postun(shared-mime-info-data-2.0-r0.4.corei7_64): waitpid(78) rc 78 status 100 warning: %postun(shared-mime-info-data-2.0-r0.4.corei7_64) scriptlet failed, exit status 1 when run post uninstall scriptlet, /usr/share/mime/packages has been removed during unintall, while update-mime-database will check xml under /usr/share/mime/packages. workaround by create this dir before update, then remove it (From OE-Core rev: 6f262a316d6c32ff9ce96ab4bd95726772b5f20f) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
71 lines
2.4 KiB
Plaintext
71 lines
2.4 KiB
Plaintext
#
|
|
# This class is used by recipes installing mime types
|
|
#
|
|
|
|
DEPENDS += "${@bb.utils.contains('BPN', 'shared-mime-info', '', 'shared-mime-info', d)}"
|
|
PACKAGE_WRITE_DEPS += "shared-mime-info-native"
|
|
MIMEDIR = "${datadir}/mime"
|
|
|
|
mime_postinst() {
|
|
if [ "x$D" != "x" ]; then
|
|
$INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \
|
|
mlprefix=${MLPREFIX} \
|
|
mimedir=${MIMEDIR}
|
|
else
|
|
echo "Updating MIME database... this may take a while."
|
|
update-mime-database $D${MIMEDIR}
|
|
fi
|
|
}
|
|
|
|
mime_postrm() {
|
|
if [ "x$D" != "x" ]; then
|
|
$INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \
|
|
mlprefix=${MLPREFIX} \
|
|
mimedir=${MIMEDIR}
|
|
else
|
|
echo "Updating MIME database... this may take a while."
|
|
# $D${MIMEDIR}/packages belong to package shared-mime-info-data,
|
|
# packages like libfm-mime depend on shared-mime-info-data.
|
|
# after shared-mime-info-data uninstalled, $D${MIMEDIR}/packages
|
|
# is removed, but update-mime-database need this dir to update
|
|
# database, workaround to create one and remove it later
|
|
if [ ! -d $D${MIMEDIR}/packages ]; then
|
|
mkdir -p $D${MIMEDIR}/packages
|
|
update-mime-database $D${MIMEDIR}
|
|
rmdir --ignore-fail-on-non-empty $D${MIMEDIR}/packages
|
|
else
|
|
update-mime-database $D${MIMEDIR}
|
|
fi
|
|
fi
|
|
}
|
|
|
|
python populate_packages_append () {
|
|
packages = d.getVar('PACKAGES').split()
|
|
pkgdest = d.getVar('PKGDEST')
|
|
mimedir = d.getVar('MIMEDIR')
|
|
|
|
for pkg in packages:
|
|
mime_packages_dir = '%s/%s%s/packages' % (pkgdest, pkg, mimedir)
|
|
mimes_types_found = False
|
|
if os.path.exists(mime_packages_dir):
|
|
for f in os.listdir(mime_packages_dir):
|
|
if f.endswith('.xml'):
|
|
mimes_types_found = True
|
|
break
|
|
if mimes_types_found:
|
|
bb.note("adding mime postinst and postrm scripts to %s" % pkg)
|
|
postinst = d.getVar('pkg_postinst_%s' % pkg)
|
|
if not postinst:
|
|
postinst = '#!/bin/sh\n'
|
|
postinst += d.getVar('mime_postinst')
|
|
d.setVar('pkg_postinst_%s' % pkg, postinst)
|
|
postrm = d.getVar('pkg_postrm_%s' % pkg)
|
|
if not postrm:
|
|
postrm = '#!/bin/sh\n'
|
|
postrm += d.getVar('mime_postrm')
|
|
d.setVar('pkg_postrm_%s' % pkg, postrm)
|
|
if pkg != 'shared-mime-info-data':
|
|
bb.note("adding shared-mime-info-data dependency to %s" % pkg)
|
|
d.appendVar('RDEPENDS_' + pkg, " " + d.getVar('MLPREFIX')+"shared-mime-info-data")
|
|
}
|