summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-12-29 14:10:01 +0000
committerjlam <jlam@pkgsrc.org>2005-12-29 14:10:01 +0000
commit6517d6f417000c952c213289b0c829c8c7e31e20 (patch)
tree34cab1b2622881daad09ff647d27f5d7f35c5e90 /mk
parente871bba6d7e056e01a41da7f9d65db22bb0852a6 (diff)
downloadpkgsrc-6517d6f417000c952c213289b0c829c8c7e31e20.tar.gz
Allow avoiding the automatic update of the fonts databases by setting
PKG_UPDATE_FONTS_DB=no in the environment or /etc/mk.conf. This can be beneficial when installing large numbers of fonts packages into the same directories as it avoids destroying and recreating the same database files over and over again. This might make it possible someday to run fc-cache, which is sometimes very time-consuming, from the +FONTS script automatically.
Diffstat (limited to 'mk')
-rw-r--r--mk/install/bsd.pkginstall.mk8
-rw-r--r--mk/install/fonts14
2 files changed, 20 insertions, 2 deletions
diff --git a/mk/install/bsd.pkginstall.mk b/mk/install/bsd.pkginstall.mk
index a89e2bcd463..b322375a143 100644
--- a/mk/install/bsd.pkginstall.mk
+++ b/mk/install/bsd.pkginstall.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.32 2005/12/29 06:18:53 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.33 2005/12/29 14:10:01 jlam Exp $
#
# This Makefile fragment is included by mk/install/pkginstall.mk and is
# the implemenation file for the common INSTALL/DEINSTALL scripts
@@ -639,6 +639,10 @@ ${INSTALL_FONTS_FILE}: ../../mk/install/fonts
# PKG_REGISTER_SHELLS indicates whether to automatically register shells
# in /etc/shells. It is either YES or NO and defaults to YES.
#
+# PKG_UPDATE_FONTS_DB indicates whether to automatically update the fonts
+# databases in directories where fonts have been installed or
+# removed. It is either YES or NO and defaults to YES.
+#
# These values merely set the defaults for INSTALL/DEINSTALL scripts, but
# they may be overridden by resetting them in the environment.
#
@@ -646,10 +650,12 @@ PKG_CREATE_USERGROUP?= YES
PKG_CONFIG?= YES
PKG_RCD_SCRIPTS?= NO
PKG_REGISTER_SHELLS?= YES
+PKG_UPDATE_FONTS_DB?= YES
FILES_SUBST+= PKG_CREATE_USERGROUP=${PKG_CREATE_USERGROUP:Q}
FILES_SUBST+= PKG_CONFIG=${PKG_CONFIG:Q}
FILES_SUBST+= PKG_RCD_SCRIPTS=${PKG_RCD_SCRIPTS:Q}
FILES_SUBST+= PKG_REGISTER_SHELLS=${PKG_REGISTER_SHELLS:Q}
+FILES_SUBST+= PKG_UPDATE_FONTS_DB=${PKG_UPDATE_FONTS_DB:Q}
# Substitute for various programs used in the DEINSTALL/INSTALL scripts and
# in the rc.d scripts.
diff --git a/mk/install/fonts b/mk/install/fonts
index 5501c8a1c8e..ab38e0b9090 100644
--- a/mk/install/fonts
+++ b/mk/install/fonts
@@ -1,6 +1,6 @@
#!@SH@
#
-# $NetBSD: fonts,v 1.7 2005/12/29 03:44:38 jlam Exp $
+# $NetBSD: fonts,v 1.8 2005/12/29 14:10:01 jlam Exp $
#
# +FONTS - font database management script
#
@@ -38,8 +38,20 @@ PKG_METADATA_DIR="${1-`${PWD_CMD}`}"
: ${PKGNAME=${PKG_METADATA_DIR##*/}}
: ${PKG_PREFIX=@PREFIX@}
+case "${PKG_UPDATE_FONTS_DB:-@PKG_UPDATE_FONTS_DB@}" in
+[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+ _PKG_UPDATE_FONTS_DB=yes
+ ;;
+[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+ _PKG_UPDATE_FONTS_DB=no
+ ;;
+esac
+
${SED} -n "/^\# FONTS: /{s/^\# FONTS: //;p;}" ${SELF} | ${SORT} -u |
{ while read dir font_type; do
+ case ${_PKG_UPDATE_FONTS_DB} in
+ no) continue ;;
+ esac
case $dir in
"") continue ;;
[!/]*) dir="${PKG_PREFIX}/$dir" ;;