From 0b9ad96b61451d5356c61d10994e3881bb040129 Mon Sep 17 00:00:00 2001
From: RĂ¼diger Timm <rt@openoffice.org>
Date: Mon, 6 Feb 2006 15:40:14 +0000
Subject: INTEGRATION: CWS cloph02 (1.21.22); FILE MERGED 2006/01/14 01:32:36
 cloph 1.21.22.2: Issue number: #i57871# Submitted by: cloph Don't assume the
 script can find the binary to update the icon-cache.. Check for existence of
 the cache, then touch the theme-dir to invalidate the cache and then try to
 update the cache. 2005/12/12 19:27:09 cloph 1.21.22.1: Issue number: #i57871#
 Submitted by: cloph

---
 sysui/desktop/redhat/redhat-menus.spec | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

(limited to 'sysui')

diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec
index 3487e2c01731..25045165f7ec 100644
--- a/sysui/desktop/redhat/redhat-menus.spec
+++ b/sysui/desktop/redhat/redhat-menus.spec
@@ -77,6 +77,22 @@ if [ -x /usr/bin/update-mime-database ]; then
   update-mime-database /usr/share/mime
 fi
 
+# run only on first install, since postun is run when updating
+# post would be run before the old files are removed 
+if [ "$1" = "1" ] ; then  # first install
+  for theme in gnome hicolor locolor; do
+    if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then
+      # touch it, just in case we cannot find the binary...
+      touch /usr/share/icons/$theme
+      if (which gtk-update-icon-cache); then
+        gtk-update-icon-cache /usr/share/icons/$theme
+      fi
+      # ignore errors (e.g. when there is a cache, but no index.theme)
+      true
+    fi
+  done
+fi
+
 # update /etc/mime.types
 # backing out existing entries to avoid duplicates
 sed '
@@ -245,6 +261,18 @@ if [ "$1" = 0 ] ; then
     update-mime-database /usr/share/mime
   fi
 fi
+#run always
+for theme in gnome hicolor locolor; do
+  if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then
+    # touch it, just in case we cannot find the binary...
+    touch /usr/share/icons/$theme
+    if (which gtk-update-icon-cache); then
+      gtk-update-icon-cache /usr/share/icons/$theme
+    fi
+    # ignore errors (e.g. when there is a cache, but no index.theme)
+    true
+  fi
+done
 
 %files
 %attr(0755,root,root) /usr/bin/soffice
-- 
cgit