]> spindle.queued.net Git - midori/commitdiff
Update icon cache on uninstall, catch missing gtk-update-icon-cache
authorChristian Dywan <christian@twotoasts.de>
Sat, 31 May 2008 12:56:33 +0000 (14:56 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 31 May 2008 12:57:07 +0000 (14:57 +0200)
wscript

diff --git a/wscript b/wscript
index 0d1eec382768db464cfa607d02d09d57b7df2b30..8783dcbb1be476985b70b1050ffc8073f56ce4ac 100644 (file)
--- a/wscript
+++ b/wscript
@@ -85,12 +85,16 @@ def build (bld):
         install_files ('DATADIR', 'applications', 'midori.desktop')
 
 def shutdown ():
-    dir = Common.path_install('DATADIR', 'icons/hicolor')
-    if Params.g_commands['install']:
-        if not Params.g_options.destdir:
-            # update the pixmap cache directory
-            Params.pprint('YELLOW', "Updating Gtk icon cache.")
+    dir = Common.path_install ('DATADIR', 'icons/hicolor')
+    icon_cache_updated = False
+    if not Params.g_options.destdir:
+        # update the pixmap cache directory
+        try:
             subprocess.call (['gtk-update-icon-cache', '-q', '-f', '-t', dir])
-        else:
-            Params.pprint('YELLOW', "Icon cache not updated. After install, run this:")
-            Params.pprint('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)
+            Params.pprint ('YELLOW', "Updated Gtk icon cache.")
+            icon_cache_updated = True
+        except:
+            Params.pprint ('RED', "Failed to update icon cache.")
+    if not icon_cache_updated:
+        Params.pprint ('YELLOW', "Icon cache not updated. After install, run this:")
+        Params.pprint ('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)