From 567ca3de7b098fbfcd8e35c8d53a4eab4c6ea1d3 Mon Sep 17 00:00:00 2001 From: jlam Date: Tue, 14 Mar 2006 17:14:47 +0000 Subject: 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". --- mk/plist/plist-info.awk | 21 ++++++++++++++++----- mk/plist/plist.mk | 16 ++++++++++++++-- 2 files changed, 30 insertions(+), 7 deletions(-) (limited to 'mk/plist') diff --git a/mk/plist/plist-info.awk b/mk/plist/plist-info.awk index 543c2a660cb..2d54549629d 100644 --- a/mk/plist/plist-info.awk +++ b/mk/plist/plist-info.awk @@ -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 @@ BEGIN { 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 @@ BEGIN { ### 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 @@ BEGIN { ### 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 --git a/mk/plist/plist.mk b/mk/plist/plist.mk index 79532d2b583..1639fa6d740 100644 --- a/mk/plist/plist.mk +++ b/mk/plist/plist.mk @@ -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 @@ _LIBTOOL_EXPAND= \ 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} -- cgit v1.2.3