From dc1bb7a5532411bc9cb7e8678bc540c44fd2cd63 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Thu, 17 Jan 2013 20:56:40 +0800 Subject: gtk-immodules-cache.bbclass:fix support postrm at image creation time Let postrm use the same logic as the postinst to run on both build machine and target [YOCTO #3633] Signed-off-by: Hongxu Jia Signed-off-by: Saul Wold --- meta/classes/gtk-immodules-cache.bbclass | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass index 9ffb03b9da..a8855af60d 100644 --- a/meta/classes/gtk-immodules-cache.bbclass +++ b/meta/classes/gtk-immodules-cache.bbclass @@ -31,7 +31,18 @@ fi gtk_immodule_cache_postrm() { if [ "x$D" != "x" ]; then - exit 1 + for maj_ver in 2 3; do + if [ -x $D${bindir}/gtk-query-immodules-$maj_ver.0 ]; then + IMFILES=$(ls $D${libdir}/gtk-$maj_ver.0/*/immodules/*.so) + ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-$maj_ver.0')} \ + $IMFILES > $D/etc/gtk-$maj_ver.0/gtk.immodules 2>/dev/null && + sed -i -e "s:$D::" $D/etc/gtk-$maj_ver.0/gtk.immodules + + [ $? -ne 0 ] && exit 1 + fi + done + + exit 0 fi if [ ! -z `which gtk-query-immodules-2.0` ]; then gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules -- cgit v1.2.3