commit:     9480cc629e2f98caf0bdf410724a294377e07f57
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 19 03:08:48 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 19 03:08:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9480cc62

font.eclass: check for dir existence in _update_fontcache

It's still subject to a narrow race but nowhere near as bad as 
removed-last-font-now-
its-gone.

Closes: https://bugs.gentoo.org/754702
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/font.eclass | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/font.eclass b/eclass/font.eclass
index 83636ac3fed5..4970c959f7cd 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -186,9 +186,11 @@ font_src_install() {
 # @DESCRIPTION:
 # Updates fontcache if !prefix and media-libs/fontconfig installed
 _update_fontcache() {
-       # unreadable font files = fontconfig segfaults
-       find "${EROOT}"/usr/share/fonts/ -type f '!' -perm 0644 \
-               -exec chmod -v 0644 2>/dev/null {} + || die "failed to fix font 
files perms"
+       if [[ -d "${EROOT}"/usr/share/fonts ]] ; then
+               # unreadable font files = fontconfig segfaults
+               find "${EROOT}"/usr/share/fonts/ -type f '!' -perm 0644 \
+                       -exec chmod -v 0644 2>/dev/null {} + || die "failed to 
fix font files perms"
+       fi
 
        if [[ -z ${ROOT} ]] ; then
                if has_version media-libs/fontconfig ; then

Reply via email to