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

login
register
mail settings
Submitter Martin Jansa
Date Dec. 22, 2012, 7:58 p.m.
Message ID <1356206329-12627-1-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/41507/
State Accepted
Commit 6c2962dc117304c542fd5458b39524ecdb81cae9
Headers show

Comments

Martin Jansa - Dec. 22, 2012, 7:58 p.m.
* 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

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/gtk-icon-cache.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Martin Jansa - Dec. 22, 2012, 8:14 p.m.
On Sat, Dec 22, 2012 at 08:58:49PM +0100, Martin Jansa wrote:
> * 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

> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/classes/gtk-icon-cache.bbclass | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
> index f87a30f..7c7dd78 100644
> --- a/meta/classes/gtk-icon-cache.bbclass
> +++ b/meta/classes/gtk-icon-cache.bbclass
> @@ -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
> -- 
> 1.8.0.2
>

Patch

diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index f87a30f..7c7dd78 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -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