From f5895dab8a99c758b2591de334e7ac3ba9eb66fb Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Tue, 13 Jan 2015 09:11:51 +0100
Subject: [PATCH] build/glib-or-gtk-build-system: Fix 'generate-icon-cache'.

Reported by Mark H Weaver <mhw@netris.org>

* guix/build/glib-or-gtk-build-system.scm (generate-icon-cache): Add check for
  existence of icons directory.
---
 guix/build/glib-or-gtk-build-system.scm | 33 +++++++++++++------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm
index 2fe7aa4474e..a404a84f3fc 100644
--- a/guix/build/glib-or-gtk-build-system.scm
+++ b/guix/build/glib-or-gtk-build-system.scm
@@ -217,22 +217,23 @@ (define* (generate-icon-cache #:key outputs #:allow-other-keys)
           ((output . directory)
            (let ((iconsdir (string-append directory
                                             "/share/icons")))
-             (with-directory-excursion iconsdir
-               (for-each
-                (lambda (dir)
-                  (unless (file-exists?
-                           (string-append iconsdir "/" dir "/"
-                                          "icon-theme.cache"))
-                    (system* "gtk-update-icon-cache"
-                             "--ignore-theme-index"
-                             (string-append iconsdir "/" dir))))
-                (scandir "."
-                         (lambda (name)
-                           (and
-                            (not (equal? name "."))
-                            (not (equal? name ".."))
-                            (equal? 'directory
-                                    (stat:type (stat name))))))))
+             (when (file-exists? iconsdir)
+               (with-directory-excursion iconsdir
+                 (for-each
+                  (lambda (dir)
+                    (unless (file-exists?
+                             (string-append iconsdir "/" dir "/"
+                                            "icon-theme.cache"))
+                      (system* "gtk-update-icon-cache"
+                               "--ignore-theme-index"
+                               (string-append iconsdir "/" dir))))
+                  (scandir "."
+                           (lambda (name)
+                             (and
+                              (not (equal? name "."))
+                              (not (equal? name ".."))
+                              (equal? 'directory
+                                      (stat:type (stat name)))))))))
              #t)))
          outputs))
 
-- 
GitLab