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.
This commit is contained in:
Federico Beffa 2015-01-13 09:11:51 +01:00
parent 65cd77db20
commit f5895dab8a

View file

@ -217,22 +217,23 @@ needed."
((output . directory) ((output . directory)
(let ((iconsdir (string-append directory (let ((iconsdir (string-append directory
"/share/icons"))) "/share/icons")))
(with-directory-excursion iconsdir (when (file-exists? iconsdir)
(for-each (with-directory-excursion iconsdir
(lambda (dir) (for-each
(unless (file-exists? (lambda (dir)
(string-append iconsdir "/" dir "/" (unless (file-exists?
"icon-theme.cache")) (string-append iconsdir "/" dir "/"
(system* "gtk-update-icon-cache" "icon-theme.cache"))
"--ignore-theme-index" (system* "gtk-update-icon-cache"
(string-append iconsdir "/" dir)))) "--ignore-theme-index"
(scandir "." (string-append iconsdir "/" dir))))
(lambda (name) (scandir "."
(and (lambda (name)
(not (equal? name ".")) (and
(not (equal? name "..")) (not (equal? name "."))
(equal? 'directory (not (equal? name ".."))
(stat:type (stat name)))))))) (equal? 'directory
(stat:type (stat name)))))))))
#t))) #t)))
outputs)) outputs))