summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2004-01-02 12:28:05 +0000
committerseb <seb@pkgsrc.org>2004-01-02 12:28:05 +0000
commitbbbfd5c266d685331c9b3258351f4a22fb27500f (patch)
treefa16d01aebc2fe723cddba2aebf1ccc9903c0a42 /mk/bsd.pkg.mk
parentc99c24c7399b9734ffa5b20f71fceb1af2f8617e (diff)
downloadpkgsrc-bbbfd5c266d685331c9b3258351f4a22fb27500f.tar.gz
Introduce dynamic registration of info files in PLIST.
For each file listed in INFO_FILES the installed files matching ${PREFIX}/${INFO_DIR}/filename(-[0-9]+)? are registered as belonging to the package. Also ignore the same files in print-PLIST target. Info files should not be listed in PLIST files anymore but the awk code snippet (_PLIST_AWK_INFO) in charge of actually dealing with info files for the plist target will strip any it finds in them. Now for the reason behind this... Older makeinfo command (before pre-release version 4.5.90 or before release version 4.6) had SPLIT_SIZE_THRESHOLD: when an info file size was >= SPLIT_SIZE_THRESHOLD then the info file was split in chunks of DEFAULT_SPLIT_SIZE size. DEFAULT_SPLIT_SIZE in older versions of makeinfo was 50000 (bytes) and SPLIT_SIZE_THRESHOLD was 70000. So if an info file has a size < 70000 and is processed by makeinfo < 4.6 it is not split in chunks. But if it is processed by makeinfo >= 4.6 texinfo.mk to emulate older version automatically adds `--split-size=50000' to makeinfo's command line and this time the info file is split in chunks... This can lead to PLIST inconsistency from platform to platform or more exactly from version to version of makeinfo. Now we don't have to care about this problem and the info files removal from PLIST files can happen.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk41
1 files changed, 40 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index c0e3a434d91..fbfde9caacf 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1332 2003/12/31 12:29:16 salo Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1333 2004/01/02 12:28:05 seb Exp $
#
# This file is in the public domain.
#
@@ -4440,6 +4440,11 @@ _PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^info\/dir$$/)
.if defined(INFO_DIR) && empty(INFO_DIR:Minfo)
_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^${INFO_DIR:S|/|\\/|g}\/dir$$/)
.endif
+.if !empty(INFO_FILES)
+. for _f_ in ${INFO_FILES}
+_PRINT_PLIST_AWK_IGNORE+= || ($$0 ~ /^${INFO_DIR:S|/|\\/|g}\/${_f_}(-[0-9]+)?$$/)
+. endfor
+.endif
# Common (system) directories not to generate @dirrm statements for
# Reads MTREE_FILE and generate awk statements that will
@@ -4871,6 +4876,36 @@ _PLIST_AWK_IMAKE_MAN= \
sub("\\.0$$", sect); \
}
+# plist awk pattern-action statement to handle info files:
+# generate list of files matching ${PREFIX}/${INFO_DIR}/filename(-[0-9]+)?
+# for `filename' being each word of INFO_FILES in turn.
+# Notes:
+# - first the filenames matching ${PREFIX}/${INFO_DIR}/filename*
+# are generated with ls then they are filtered by the exact pattern.
+# - ${PREFIX}/${INFO_DIR}/filename is single quoted and single quote
+# escaped
+# XXX When all info file entries will be removed from PLIST files
+# the non-BEGIN pattern-action statements generated below will be retired.
+_PLIST_AWK_INFO=
+.if !empty(INFO_FILES)
+. for _f_ in ${INFO_FILES}
+_PLIST_AWK_INFO+= \
+BEGIN { \
+ cmd="${_f_}"; gsub("'\''", "\\'\''", cmd); \
+ sub("^", "${LS} '\''${PREFIX}/${INFO_DIR}/", cmd); \
+ sub("$$", "'\''*", cmd); \
+ while ((cmd | getline l) > 0) { \
+ if (match(l, ".*/${_f_}(-[0-9]+)?$$")) { \
+ sub("^${PREFIX}/", "", l); \
+ print l; \
+ } \
+ } \
+ close(cmd); \
+} \
+/^${INFO_DIR:S|/|\\/|g}\/${_f_}(-[0-9]+)?$$/ { next; }
+. endfor
+.endif
+
# _PLIST_AWK_SCRIPT hold the complete awk script for plist target.
#
_PLIST_AWK_SCRIPT= '
@@ -4878,6 +4913,10 @@ _PLIST_AWK_SCRIPT= '
# See comments above about _PLIST_AWK_SUBST: it contains single quotes!
# So _PLIST_AWK_SCRIPT is intended to be single quoted.
_PLIST_AWK_SCRIPT+= ${_PLIST_AWK_SUBST}
+# Generated entries for info files
+.if !empty(INFO_FILES)
+_PLIST_AWK_SCRIPT+= ${_PLIST_AWK_INFO}
+.endif
# Strip the '.gz' suffixes on man entries
_PLIST_AWK_SCRIPT+= ${_PLIST_AWK_STRIP_MANZ}
# Deal with MANINSTALL and man entries