pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/plist Teach the plist framework a new variable IGNO...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/70cf095529e3
branches:  trunk
changeset: 509796:70cf095529e3
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Mar 14 17:14:47 2006 +0000

description:
Teach the plist framework a new variable IGNORE_INFO_DIRS that is a
list of ${PREFIX}-relative paths of directories that do *not* contain
info files.  This allows avoiding the auto info-file-entry munging
that occurs for all PLIST entries that are in directories named "info".

diffstat:

 mk/plist/plist-info.awk |  21 ++++++++++++++++-----
 mk/plist/plist.mk       |  16 ++++++++++++++--
 2 files changed, 30 insertions(+), 7 deletions(-)

diffs (113 lines):

diff -r 4ff708336821 -r 70cf095529e3 mk/plist/plist-info.awk
--- a/mk/plist/plist-info.awk   Tue Mar 14 17:14:17 2006 +0000
+++ b/mk/plist/plist-info.awk   Tue Mar 14 17:14:47 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: plist-info.awk,v 1.7 2006/03/14 15:32:18 jlam Exp $
+# $NetBSD: plist-info.awk,v 1.8 2006/03/14 17:14:47 jlam Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,6 +41,9 @@
 ###
 ### Certain environment variables must be set prior to running this script:
 ###
+### IGNORE_INFO_PATH is a colon-separated list of ${PREFIX}-relative paths
+###    that do *not* contain info files.
+###
 ### INFO_DIR is the ${PREFIX}-relative path to the installed info pages.
 ###
 ### LS is the path to the "ls" binary.
@@ -59,12 +62,17 @@
        MANZ = ENVIRON["MANZ"] ? ENVIRON["MANZ"] : "no"
        PREFIX = ENVIRON["PREFIX"] ? ENVIRON["PREFIX"] : "/usr/pkg"
        TEST = ENVIRON["TEST"] ? ENVIRON["TEST"] : "test"
+
+       IGNORE_INFO_REGEXP = ENVIRON["IGNORE_INFO_PATH"] ? ENVIRON["IGNORE_INFO_PATH"] : ""
+       gsub(":", "|", IGNORE_INFO_REGEXP)
+       IGNORE_INFO_REGEXP = "^(" IGNORE_INFO_REGEXP ")/"
 }
 
 ###
 ### Canonicalize info page entries by stripping any ".gz" suffixes.
 ###
-/^[^@]/ && /^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+\.gz$/ {
+/^[^@]/ && ($0 !~ IGNORE_INFO_REGEXP) && \
+/^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+\.gz$/ {
        sub("\\.gz$", "")
 }
 
@@ -72,14 +80,16 @@
 ### Ignore *-1, *-2, etc. files in the PLIST as we get the list of
 ### installed split files below.
 ###
-/^[^@]/ && /^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+$/ {
+/^[^@]/ && ($0 !~ IGNORE_INFO_REGEXP) && \
+/^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+$/ {
        next
 }
 
 ###
 ### Convert info/ to ${INFO_DIR}/ for all info page entries.
 ###
-/^[^@]/ && /^([^\/]*\/)*info\/[^\/]*(\.info)?$/ {
+/^[^@]/ && ($0 !~ IGNORE_INFO_REGEXP) && \
+/^([^\/]*\/)*info\/[^\/]*(\.info)?$/ {
        if ($0 ~ "^info/") {
                sub("^info/", INFO_DIR "/")
        } else {
@@ -91,7 +101,8 @@
 ### For each info page entry, print all of the installed info sub-pages
 ### associated with that entry.
 ###
-/^[^@]/ && ($0 ~ "^([^\/]*\/)*" INFO_DIR "\/[^\/]*(\.info)?$") {
+/^[^@]/ && ($0 !~ IGNORE_INFO_REGEXP) && \
+($0 ~ "^([^\/]*\/)*" INFO_DIR "\/[^\/]*(\.info)?$") {
        cmd = TEST " -f " PREFIX "/" $0 " -o -f " PREFIX "/" $0 ".gz"
        if (system(cmd) == 0) {
                base = $0
diff -r 4ff708336821 -r 70cf095529e3 mk/plist/plist.mk
--- a/mk/plist/plist.mk Tue Mar 14 17:14:17 2006 +0000
+++ b/mk/plist/plist.mk Tue Mar 14 17:14:47 2006 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: plist.mk,v 1.5 2006/03/14 16:54:28 jlam Exp $
+# $NetBSD: plist.mk,v 1.6 2006/03/14 17:14:47 jlam Exp $
 #
 # This Makefile fragment handles the creation of PLISTs for use by
 # pkg_create(8).
 #
-# The following variables affect 
+# The following variables affect the PLIST generation:
 #
 #    PLIST_TYPE specifies whether the generated PLIST is derived
 #      automatically from the installed files, or if the PLIST entries
@@ -18,6 +18,9 @@
 #      that outputs contents for a PLIST to stdout and is appended to
 #      the contents of ${PLIST_SRC}.
 #
+#    IGNORE_INFO_DIRS is a list of ${PREFIX}-relative paths that do
+#      *not* contain info files.
+#
 
 .if ${PKG_INSTALLATION_TYPE} == "pkgviews"
 PLIST_TYPE?=   dynamic
@@ -75,11 +78,20 @@
                SORT=${TOOLS_SORT:Q} TEST=${TOOLS_TEST:Q}               \
        ${SH} ${.CURDIR}/../../mk/plist/libtool-expand
 
+.if !defined(_IGNORE_INFO_PATH)
+.  for _dir_ in ${IGNORE_INFO_DIRS}
+_IGNORE_INFO_PATH:=    ${_IGNORE_INFO_PATH}:${_dir_}
+.  endfor
+_IGNORE_INFO_PATH:=    ${_IGNORE_INFO_PATH:S/^://}
+.endif
+MAKEVARS+=             _IGNORE_INFO_PATH
+
 # _PLIST_AWK_ENV holds the shell environment passed to the awk script
 # that does post-processing of the PLIST.  See the individual *.awk
 # scripts for information on each of the variable set in the environment.
 #
 _PLIST_AWK_ENV+=       IMAKE_MANINSTALL=${_IMAKE_MANINSTALL:Q}
+_PLIST_AWK_ENV+=       IGNORE_INFO_PATH=${_IGNORE_INFO_PATH:Q}
 _PLIST_AWK_ENV+=       INFO_DIR=${INFO_DIR:Q}
 _PLIST_AWK_ENV+=       LIBTOOLIZE_PLIST=${LIBTOOLIZE_PLIST:Q}
 _PLIST_AWK_ENV+=       LIBTOOL_EXPAND=${_LIBTOOL_EXPAND:Q}



Home | Main Index | Thread Index | Old Index