Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: fonts@g.o, Matt Turner <mattst88@g.o>
Subject: Re: [gentoo-dev] [PATCH 2/2] font.eclass: Remove racy pkg_postinst code
Date: Tue, 08 Nov 2022 04:11:06
Message-Id: 568F0AB7-82C2-4E35-828B-7617AF31B04D@gentoo.org
In Reply to: [gentoo-dev] [PATCH 2/2] font.eclass: Remove racy pkg_postinst code by Matt Turner
1 > On 8 Nov 2022, at 01:10, Matt Turner <mattst88@g.o> wrote:
2 >
3 > Noticed on ChromeOS when installing a large number of font packages in
4 > parallel:
5 >
6 > /usr/share/fonts/noto/NotoSerifThai-Regular.ttf#new' from 0004 (------r--) to 2440 (r--r-S---)
7 > * ERROR: media-fonts/ipaex-004.01-r1::chromiumos failed (postinst phase):
8 > * failed to fix font files perms
9 >
10 > The "#new" filename is the hint. Portage uses "#new" suffixes when
11 > copying files to the system, and then renames them to their final
12 > filenames.
13 >
14 > This code was executing while another font was in the process of being
15 > copied to the system. Font packages should just ensure that they install
16 > files with correct permissions to begin with, and all except
17 > media-fonts/x11fonts-jmk already use 0644 permissions.
18 > media-fonts/x11fonts-jmk used 0444 (which was probably fine) until the
19 > previous commit which changes its installed files to 0644.
20 >
21 > Bug: https://bugs.gentoo.org/187774
22 > Signed-off-by: Matt Turner <mattst88@g.o>
23 > ---
24 > eclass/font.eclass | 6 ------
25 > 1 file changed, 6 deletions(-)
26 >
27 > diff --git a/eclass/font.eclass b/eclass/font.eclass
28 > index 4970c959f7c..0196755ce3e 100644
29 > --- a/eclass/font.eclass
30 > +++ b/eclass/font.eclass
31 > @@ -186,12 +186,6 @@ font_src_install() {
32 > # @DESCRIPTION:
33 > # Updates fontcache if !prefix and media-libs/fontconfig installed
34 > _update_fontcache() {
35 > - if [[ -d "${EROOT}"/usr/share/fonts ]] ; then
36 > - # unreadable font files = fontconfig segfaults
37 > - find "${EROOT}"/usr/share/fonts/ -type f '!' -perm 0644 \
38 > - -exec chmod -v 0644 2>/dev/null {} + || die "failed to fix font files perms"
39 > - fi
40 > -
41 > if [[ -z ${ROOT} ]] ; then
42 > if has_version media-libs/fontconfig ; then
43 > ebegin "Updating global fontcache"
44 > --
45
46 Can we put an fperms call in src_install just in case (like the eclass originally had
47 before moved to pkg_postinst)?

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies