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
1 changed files with 17 additions and 16 deletions

View File

@ -217,22 +217,23 @@ needed."
((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))