From 54ea63f1611810182d299b6c1edfa331d320895c Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 31 May 2008 14:56:33 +0200 Subject: [PATCH] Update icon cache on uninstall, catch missing gtk-update-icon-cache --- wscript | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/wscript b/wscript index 0d1eec38..8783dcbb 100644 --- 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) -- 2.39.5