diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2018-07-09 21:20:57 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2018-07-09 21:20:57 +0000 |
commit | 393a01503cb3d1b5a589eb932c23f626c0c335c3 (patch) | |
tree | 48bb50eb4fa7544b569ac4ba3d79798dd167183c /font | |
parent | c50c5c516221bf8b6d3a221279e3bcb9167e8705 (diff) |
Make sure the fontconfig cache in the xbaseXX.tgz set is valid.
Tarballs only store timestamps with 1s resolution, while the
fontconfig cache uses nano-second resolution from the filesystem to
check that a directory hasn't changed.
So the font directories extracted by the installer were almost always
considered out of date, causing applications that use fontconfig to
trigger a rebuild of the cache.
Now, when installing with DESTDIR set, we use a perl one-liner to
remove the nanoseconds from the mtime of the fonts directories before
running fc-cache, so that the timestamps recorded in the cache match
what will be set after extracting the xfont set.
Help and suggestions from at least guenther@, millert@, espie@
and deraadt@
Diffstat (limited to 'font')
-rw-r--r-- | font/alias/Makefile.bsd-wrapper | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/font/alias/Makefile.bsd-wrapper b/font/alias/Makefile.bsd-wrapper index 98144c910..55f26f528 100644 --- a/font/alias/Makefile.bsd-wrapper +++ b/font/alias/Makefile.bsd-wrapper @@ -1,16 +1,6 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.5 2016/11/19 08:38:15 tb Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.6 2018/07/09 21:20:56 matthieu Exp $ afterinstall: - @if test -z "$(DESTDIR)"; then \ - echo "fc-cache -s -v ${DESTDIR}/usr/X11R6/lib/X11/fonts";\ - fc-cache -s -v ${DESTDIR}/usr/X11R6/lib/X11/fonts ;\ - chmod 644 ${DESTDIR}/var/cache/fontconfig/*; \ - else \ - echo "fc-cache -y ${DESTDIR} -s -v /usr/X11R6/lib/X11/fonts";\ - fc-cache -y ${DESTDIR} -s -v /usr/X11R6/lib/X11/fonts;\ - chown root:wheel ${DESTDIR}/var/cache/fontconfig/*; \ - chmod 644 ${DESTDIR}/var/cache/fontconfig/*; \ - fi .for fdir in 100dpi 75dpi OTF TTF Type1 cyrillic misc rm -f ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.dir mkfontdir ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir} @@ -22,5 +12,18 @@ afterinstall: chown ${BINOWN}:${BINGRP} ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.scale chmod 644 ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.scale .endfor + if test -z "$(DESTDIR)"; then \ + echo "fc-cache -s -v ${DESTDIR}/usr/X11R6/lib/X11/fonts";\ + fc-cache -s -v ${DESTDIR}/usr/X11R6/lib/X11/fonts ;\ + chmod 644 ${DESTDIR}/var/cache/fontconfig/*; \ + else \ + echo "truncating font directories mtimes"; \ + find "${DESTDIR}/usr/X11R6/lib/X11/fonts" -type d \ + -exec perl -e 'utime+(stat)[8,9],$$_ for @ARGV' {} + ; \ + echo "fc-cache -y ${DESTDIR} -s -v /usr/X11R6/lib/X11/fonts";\ + fc-cache -y ${DESTDIR} -s -v /usr/X11R6/lib/X11/fonts;\ + chown root:wheel ${DESTDIR}/var/cache/fontconfig/*; \ + chmod 644 ${DESTDIR}/var/cache/fontconfig/*; \ + fi .include <bsd.xorg.mk> |