profiles: Deal with non-directory items in share/icons.

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

* guix/profiles.scm (gtk-icon-themes)[build]: Check whether DIR is a directory
  before calling 'ensure-writable-directory'.
This commit is contained in:
Ludovic Courtès 2015-05-28 14:38:50 +02:00
parent 6a669bda51
commit 1ba4796d13
1 changed files with 6 additions and 3 deletions

View File

@ -649,9 +649,12 @@ creates the GTK+ 'icon-theme.cache' file for each theme."
;; Update the 'icon-theme.cache' file for each icon theme. ;; Update the 'icon-theme.cache' file for each icon theme.
(for-each (for-each
(lambda (theme) (lambda (theme)
(let ((dir (string-append #$output "/share/icons/" theme))) (let ((dir (string-append destdir "/" theme)))
(ensure-writable-directory dir) ;; Occasionally DESTDIR contains plain files, such as
(system* update-icon-cache "-t" dir))) ;; "abiword_48.png". Ignore these.
(when (file-is-directory? dir)
(ensure-writable-directory dir)
(system* update-icon-cache "-t" dir))))
(scandir destdir (negate (cut member <> '("." "..")))))))) (scandir destdir (negate (cut member <> '("." ".."))))))))
;; Don't run the hook when there's nothing to do. ;; Don't run the hook when there's nothing to do.