From fdea2f97bef6a728c2df6ec287fff2b032f6d25f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 16 Jul 2016 13:58:36 +0200 Subject: [PATCH] fontconfig: allow to disable auto font cache update Each time fontconfig is installed or updated, a lengthy process of font cache update is started automatically. In certain use-cases, f.e. when one if its dependents is used for automated build purposes, this causes an unnecessary and unwanted delay in the process. On AppVeyor CI free-tier in particular, this process takes about 5 minutes. This patch adds the ability to disable this automatic font cache update, by setting the environment variable `MSYS2_FC_CACHE_SKIP` to any non-empty value, prior to lauching `pacman`. --- mingw-w64-fontconfig/fontconfig-i686.install | 22 +++++++++++++------ .../fontconfig-x86_64.install | 20 ++++++++++++----- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/mingw-w64-fontconfig/fontconfig-i686.install b/mingw-w64-fontconfig/fontconfig-i686.install index f52c9c6bbc..618baf458e 100644 --- a/mingw-w64-fontconfig/fontconfig-i686.install +++ b/mingw-w64-fontconfig/fontconfig-i686.install @@ -6,15 +6,23 @@ post_install() { _EOF - echo -n "updating font cache... " - mingw32/bin/fc-cache -f - echo "done." + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + mingw32/bin/fc-cache -f + echo "done." + fi } post_upgrade() { - echo -n "updating font cache... " - mingw32/bin/fc-cache -f - echo "done." + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + mingw32/bin/fc-cache -f + echo "done." + fi } post_remove() { @@ -24,4 +32,4 @@ post_remove() { in mingw32/etc/fonts/conf.d/ _EOF -} \ No newline at end of file +} diff --git a/mingw-w64-fontconfig/fontconfig-x86_64.install b/mingw-w64-fontconfig/fontconfig-x86_64.install index 08e5bd10ea..469be24b49 100644 --- a/mingw-w64-fontconfig/fontconfig-x86_64.install +++ b/mingw-w64-fontconfig/fontconfig-x86_64.install @@ -6,15 +6,23 @@ post_install() { _EOF - echo -n "updating font cache... " - mingw64/bin/fc-cache -f - echo "done." + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + mingw64/bin/fc-cache -f + echo "done." + fi } post_upgrade() { - echo -n "updating font cache... " - mingw64/bin/fc-cache -f - echo "done." + if [ -n "${MSYS2_FC_CACHE_SKIP}" ]; then + echo "Warning: 'MSYS2_FC_CACHE_SKIP' set, skipping font cache update" + else + echo -n "updating font cache... " + mingw64/bin/fc-cache -f + echo "done." + fi } post_remove() {