SF.net SVN: geany-plugins:[2091] trunk/geany-plugins/wscript

eht16 at users.sourceforge.net eht16 at xxxxx
Sun May 29 18:34:11 UTC 2011


Revision: 2091
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2091&view=rev
Author:   eht16
Date:     2011-05-29 18:34:11 +0000 (Sun, 29 May 2011)

Log Message:
-----------
Update GTK icon cache on (un)install

Modified Paths:
--------------
    trunk/geany-plugins/wscript

Modified: trunk/geany-plugins/wscript
===================================================================
--- trunk/geany-plugins/wscript	2011-05-29 18:27:00 UTC (rev 2090)
+++ trunk/geany-plugins/wscript	2011-05-29 18:34:11 UTC (rev 2091)
@@ -39,7 +39,7 @@
 
 import os
 import tempfile
-from waflib import Logs, Scripting
+from waflib import Logs, Scripting, Utils
 from waflib.Tools import c_preproc
 from waflib.Errors import ConfigurationError
 from waflib.TaskGen import feature
@@ -216,6 +216,8 @@
 
     if bld.cmd == 'clean':
         remove_linguas_file()
+    if bld.cmd in ('install', 'uninstall'):
+        bld.add_post_fun(_post_install)
 
     if bld.env['INTLTOOL']:
         install_path = '${G_PREFIX}/share/locale' if is_win32 else '${LOCALEDIR}'
@@ -232,6 +234,21 @@
     bld.recurse(enabled_plugins)
 
 
+def _post_install(ctx):
+    is_win32 = target_is_win32(ctx)
+    if is_win32:
+        return
+    theme_dir = Utils.subst_vars('${DATADIR}/icons/hicolor', ctx.env)
+    icon_cache_updated = False
+    if not ctx.options.destdir:
+        ctx.exec_command('gtk-update-icon-cache -q -f -t %s' % theme_dir)
+        Logs.pprint('GREEN', 'GTK icon cache updated.')
+        icon_cache_updated = True
+    if not icon_cache_updated:
+        Logs.pprint('YELLOW', 'Icon cache not updated. After install, run this:')
+        Logs.pprint('YELLOW', 'gtk-update-icon-cache -q -f -t %s' % theme_dir)
+
+
 def init(ctx):
     if ctx.options.list_plugins:
         listplugins(ctx)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list