pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/plist mk: Simplify nokeywords PLIST generation.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9c1c480a9102
branches:  trunk
changeset: 386906:9c1c480a9102
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon Oct 17 18:08:02 2022 +0000

description:
mk: Simplify nokeywords PLIST generation.

Previously there was a static list of commands to filter out, which was always
going to become out of date at some point, as it has since 2009 when @pkgdir
was introduced and those entries have leaked into nokeywords files ever since.

Simply remove any line starting with "@" instead.

diffstat:

 mk/plist/plist.mk |  19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diffs (41 lines):

diff -r c10ef5fb8535 -r 9c1c480a9102 mk/plist/plist.mk
--- a/mk/plist/plist.mk Mon Oct 17 16:58:18 2022 +0000
+++ b/mk/plist/plist.mk Mon Oct 17 18:08:02 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.56 2021/11/30 09:39:50 jperkin Exp $
+# $NetBSD: plist.mk,v 1.57 2022/10/17 18:08:02 jperkin Exp $
 #
 # This Makefile fragment handles the creation of PLISTs for use by
 # pkg_create(8).
@@ -86,7 +86,9 @@
 
 # This is the path to the generated PLIST file.
 PLIST=         ${WRKDIR}/.PLIST
-_PLIST_NOKEYWORDS=${PLIST}_nokeywords
+
+# The nokeywords PLIST file strips out any pkg_create(1) "@" commands.
+_PLIST_NOKEYWORDS=     ${PLIST}_nokeywords
 
 ######################################################################
 
@@ -266,18 +268,9 @@
        ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_AWK} < ${.TARGET}-2mac > ${.TARGET}-3mag
        ${RUN} ${PKGSRC_SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} < ${.TARGET}-3mag > ${.TARGET}
 
-# for list of keywords see pkg_create(1)
 ${_PLIST_NOKEYWORDS}: ${PLIST}
-       ${RUN} ${AWK} < ${PLIST} > ${.TARGET} ' \
-               BEGIN {                                                 \
-                       FILTER="@(";                                    \
-                       FILTER=FILTER"cd|cwd|src|exec|unexec|mode|option";\
-                       FILTER=FILTER"|owner|group|comment|ignore";     \
-                       FILTER=FILTER"|ignore_inst|name|dirrm|mtree";   \
-                       FILTER=FILTER"|display|pkgdep|blddep|pkgcfl";   \
-                       FILTER=FILTER")[[:space:]]";                    \
-               };                                                      \
-               $$0 ~ FILTER { next };                                  \
+       ${RUN} ${AWK} < ${PLIST} > ${.TARGET} '                         \
+               $$0 ~ /^@/ { next };                                    \
                { print }'
 
 .if defined(INFO_FILES)



Home | Main Index | Thread Index | Old Index