Patchwork [1/4] gtk-icon-cache.bbclass:fix support postrm at image creation time

login
register
mail settings
Submitter Hongxu Jia
Date Jan. 17, 2013, 12:56 p.m.
Message ID <720b0398453c9072a2b21ff15c71c30e61dc6e76.1358427029.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/42793/
State Accepted
Commit 6ae0b8339134300d0c179bd47dc3062e0e1f2f0b
Headers show

Comments

Hongxu Jia - Jan. 17, 2013, 12:56 p.m.
When use postrm on the build machine, it installs the hook in intercept-scripts
directory and exit 0, the hook will be later invoked and it will properly call
gtk-update-icon-cache.

[YOCTO #3633]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/gtk-icon-cache.bbclass |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Patch

diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index 7c7dd78..d5fdcd5 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -32,6 +32,24 @@  done
 }
 
 gtk_icon_cache_postrm() {
+if [ "x$D" != "x" ]; then
+    if [ ! -f $INTERCEPT_DIR/update_icon_cache ]; then
+        cat << "EOF" > $INTERCEPT_DIR/update_icon_cache
+#!/bin/sh
+
+# update native pixbuf loaders
+gdk-pixbuf-query-loaders --update-cache
+
+for icondir in $D/usr/share/icons/*/ ; do
+    if [ -d $icondir ] ; then
+        gtk-update-icon-cache -fqt  $icondir
+    fi
+done
+EOF
+    fi
+    exit 0
+fi
+
 for icondir in /usr/share/icons/* ; do
     if [ -d $icondir ] ; then
         gtk-update-icon-cache -qt  $icondir