]> spindle.queued.net Git - midori/commitdiff
Check for unistd.h in waf, update cache on (un)install only
authorChristian Dywan <christian@twotoasts.de>
Sun, 1 Jun 2008 13:16:40 +0000 (15:16 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 1 Jun 2008 13:16:40 +0000 (15:16 +0200)
wscript

diff --git a/wscript b/wscript
index 8783dcbb1be476985b70b1050ffc8073f56ce4ac..6f4b95626d6d2ddcff211d4b7e7da9f26a9a6283 100644 (file)
--- a/wscript
+++ b/wscript
@@ -39,6 +39,8 @@ def configure (conf):
     conf.check_pkg ('libxml-2.0', destvar='LIBXML', vnum='2.6', mandatory=True)
     conf.check_pkg ('libsexy', destvar='LIBSEXY', vnum='0.1', mandatory=True)
 
+    conf.check_header ('unistd.h', 'HAVE_UNISTD_H')
+
     if conf.find_program ('convert', var='CONVERT'):
         icons = 'yes'
     else:
@@ -85,16 +87,17 @@ def build (bld):
         install_files ('DATADIR', 'applications', 'midori.desktop')
 
 def shutdown ():
-    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])
-            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)
+    if Params.g_commands['install'] or Params.g_commands['uninstall']:
+        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])
+                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)