Skip to content

Commit

Permalink
font.eclass: Remove racy pkg_postinst code
Browse files Browse the repository at this point in the history
Noticed on ChromeOS when installing a large number of font packages in
parallel:

/usr/share/fonts/noto/NotoSerifThai-Regular.ttf#new' from 0004 (------r--) to 2440 (r--r-S---)
* ERROR: media-fonts/ipaex-004.01-r1::chromiumos failed (postinst phase):
*   failed to fix font files perms

The "#new" filename is the hint. Portage uses "#new" suffixes when
copying files to the system, and then renames them to their final
filenames.

This code was executing while another font was in the process of being
copied to the system. Font packages should just ensure that they install
files with correct permissions to begin with, and all except
media-fonts/x11fonts-jmk already use 0644 permissions.
media-fonts/x11fonts-jmk used 0444 (which was probably fine) until the
previous commit which changes its installed files to 0644.

Bug: https://bugs.gentoo.org/187774
Signed-off-by: Matt Turner <[email protected]>
  • Loading branch information
mattst88 committed Nov 8, 2022
1 parent 4fe5fff commit e4a9c7d
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions eclass/font.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,6 @@ font_src_install() {
# @DESCRIPTION:
# Updates fontcache if !prefix and media-libs/fontconfig installed
_update_fontcache() {
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
ebegin "Updating global fontcache"
Expand Down

0 comments on commit e4a9c7d

Please sign in to comment.