Skip to contentSkip to conversation

gtk-icon-cache: don't call gtk-update-icon-cache on files

PATCH In review Martin Jansa 1 participant 2 messages Dec 22, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gtk-icon-cache: don't call gtk-update-icon-cache on files

* check if icondir is directory before calling gtk-update-icon-cache, like all other calls do
* fixes:

  | > Executing update_icon_cache
  | + chmod +x update_icon_cache
  | + ./update_icon_cache
  | gtk-update-icon-cache.real: Failed to open file /tmp-eglibc/work/qemuarm-oe-linux-gnueabi/shr-image-all/2.0-r20/rootfs/usr/share/icons/enjoy.png/.icon-theme.cache : Not a directory
  | gtk-update-icon-cache.real: Failed to open file /tmp-eglibc/work/qemuarm-oe-linux-gnueabi/shr-image-all/2.0-r20/rootfs/usr/share/icons/monav.png/.icon-theme.cache : Not a directory
  | gtk-update-icon-cache.real: Failed to open file /tmp-eglibc/work/qemuarm-oe-linux-gnueabi/shr-image-all/2.0-r20/rootfs/usr/share/icons/orrery.png/.icon-theme.cache : Not a directory
---
 meta/classes/gtk-icon-cache.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/gtk-icon-cache.bbclass +3 -1
index f87a30f..7c7dd78 100644
@@ -12,7 +12,9 @@ if [ "x$D" != "x" ]; then
 gdk-pixbuf-query-loaders --update-cache
 
 for icondir in $D/usr/share/icons/*/ ; do
-	gtk-update-icon-cache -fqt  $icondir
+    if [ -d $icondir ] ; then
+        gtk-update-icon-cache -fqt  $icondir
+    fi
 done
 EOF
     fi
Signature · 1 line
1.8.0.2
#1 lore raw
Quoted 8 lines · Martin Jansa

* check if icondir is directory before calling gtk-update-icon-cache, like all other calls do
* fixes:

  | > Executing update_icon_cache
  | + chmod +x update_icon_cache
  | + ./update_icon_cache
  | gtk-update-icon-cache.real: Failed to open file /tmp-eglibc/work/qemuarm-oe-linux-gnueabi/shr-image-all/2.0-r20/rootfs/usr/share/icons/enjoy.png/.icon-theme.cache : Not a directory
  | gtk-update-icon-cache.real: Failed to open file /tmp-eglibc/work/qemuarm-oe-linux-gnueabi/shr-image-all/2.0-r20/rootfs/usr/share/icons/monav.png/.icon-theme.cache : Not a directory
  | gtk-update-icon-cache.real: Failed to open file /tmp-eglibc/work/qemuarm-oe-linux-gnueabi/shr-image-all/2.0-r20/rootfs/usr/share/icons/orrery.png/.icon-theme.cache : Not a directory

Be aware that you need to manually remove
$INTERCEPT_DIR/update_icon_cache
otherwise such broken script is kept forever

gtk_icon_cache_postinst() {
if [ "x$D" != "x" ]; then
if [ ! -f $INTERCEPT_DIR/update_icon_cache ]; then
cat << "EOF" > $INTERCEPT_DIR/update_icon_cache

Quoted 24 lines
---
 meta/classes/gtk-icon-cache.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/gtk-icon-cache.bbclass +3 -1
index f87a30f..7c7dd78 100644
@@ -12,7 +12,9 @@ if [ "x$D" != "x" ]; then
 gdk-pixbuf-query-loaders --update-cache
 
 for icondir in $D/usr/share/icons/*/ ; do
-	gtk-update-icon-cache -fqt  $icondir
+    if [ -d $icondir ] ; then
+        gtk-update-icon-cache -fqt  $icondir
+    fi
 done
 EOF
     fi
Signature · 1 line
1.8.0.2
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]