diff options
author | Sam James <sam@gentoo.org> | 2022-10-19 04:08:48 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-10-19 04:08:48 +0100 |
commit | 9480cc629e2f98caf0bdf410724a294377e07f57 (patch) | |
tree | 4fbf3997e9d28ad543caa45640d3fdeacb231471 /eclass | |
parent | app-crypt/fcrackzip: fix build w/ Clang 16 (diff) | |
download | gentoo-9480cc629e2f98caf0bdf410724a294377e07f57.tar.gz gentoo-9480cc629e2f98caf0bdf410724a294377e07f57.tar.bz2 gentoo-9480cc629e2f98caf0bdf410724a294377e07f57.zip |
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@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/font.eclass | 8 |
1 files 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 |