profiles: Only check file contents if the file exists.

* guix/profiles.scm (fonts-dir-file): Check that files exist before using
"empty-file?".
This commit is contained in:
Ricardo Wurmus 2017-08-08 16:05:58 +02:00
parent 2d9495da23
commit 32b7506c98
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC

@ -1095,9 +1095,11 @@ files for the fonts of the @var{manifest} entries."
(unless (and (zero? (system* mkfontscale))
(zero? (system* mkfontdir)))
(exit #f))
(when (empty-file? fonts-scale-file)
(when (and (file-exists? fonts-scale-file)
(empty-file? fonts-scale-file))
(delete-file fonts-scale-file))
(when (empty-file? fonts-dir-file)
(when (and (file-exists? fonts-dir-file)
(empty-file? fonts-dir-file))
(delete-file fonts-dir-file))))
directories)))))))