pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/plist mk/plist/plist.mk: use less verbose code for ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f20c9a407628
branches:  trunk
changeset: 414659:f20c9a407628
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Mar 30 22:54:24 2020 +0000

description:
mk/plist/plist.mk: use less verbose code for picking up PLIST files

While here, add more verbose documentation on PLIST_SUBST since the way
from the package's PLIST file to the +PLIST file can easily be confused
with the other way round, which is handled by print-PLIST.

diffstat:

 mk/plist/plist.mk |  50 ++++++++++++++++++++++++++------------------------
 1 files changed, 26 insertions(+), 24 deletions(-)

diffs (71 lines):

diff -r 8802f797ef8d -r f20c9a407628 mk/plist/plist.mk
--- a/mk/plist/plist.mk Mon Mar 30 22:49:30 2020 +0000
+++ b/mk/plist/plist.mk Mon Mar 30 22:54:24 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: plist.mk,v 1.53 2020/01/05 21:38:54 rillig Exp $
+# $NetBSD: plist.mk,v 1.54 2020/03/30 22:54:24 rillig Exp $
 #
 # This Makefile fragment handles the creation of PLISTs for use by
 # pkg_create(8).
@@ -56,27 +56,18 @@
 
 ######################################################################
 
-.if exists(${PKGDIR}/PLIST.common)
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.common
-.endif
-.if exists(${PKGDIR}/PLIST.${OPSYS})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${OPSYS}
-.endif
-.if exists(${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g}
-.endif
-.if exists(${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g}
-.endif
-.if defined(EMUL_PLATFORM) && exists(${PKGDIR}/PLIST.${EMUL_PLATFORM})
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.${EMUL_PLATFORM}
-.endif
-.if exists(${PKGDIR}/PLIST)
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST
-.endif
-.if exists(${PKGDIR}/PLIST.common_end)
-PLIST_SRC_DFLT+=       ${PKGDIR}/PLIST.common_end
-.endif
+.for f in \
+       PLIST.common \
+       PLIST.${OPSYS} \
+       PLIST.${MACHINE_ARCH:C/i[3-6]86/i386/g} \
+       PLIST.${OPSYS}-${MACHINE_ARCH:C/i[3-6]86/i386/g} \
+       ${defined(EMUL_PLATFORM):?PLIST.${EMUL_PLATFORM}:} \
+       PLIST \
+       PLIST.common_end
+.  if exists(${PKGDIR}/${f})
+PLIST_SRC_DFLT+=       ${PKGDIR}/${f}
+.  endif
+.endfor
 
 #
 # If the following 3 conditions hold, then fail the package build:
@@ -145,8 +136,19 @@
 _PLIST_AWK_ENV+=       TEST=${TOOLS_TEST:Q}
 _PLIST_AWK_ENV+=       ${PLIST_AWK_ENV}
 
-# PLIST_SUBST contains package-settable "${variable}" to "value"
-# substitutions for PLISTs
+# PLIST_SUBST contains package-settable VAR=value substitutions that are
+# used when generating the actual file list for the package from the
+# package's PLIST files, as listed in PLIST_SRC. These files may contain
+# placeholders of the form ${VAR}, which are then substituted by their
+# corresponding value from PLIST_SUBST.
+#
+# Example: PLIST_SUBST+= PKGNAME=${PKGNAME_NOREV} means that the package's
+# PLIST file may contain the placeholder ${PKGNAME}, which will be replaced
+# with the package version excluding the "nb13" extension.
+#
+# The other direction of generating the package's PLIST file from the list
+# of actually installed files is covered by PRINT_PLIST_AWK. This is only
+# needed when developing the package itself, for example after an update.
 #
 PLIST_SUBST+=  OPSYS=${OPSYS:Q}                                        \
                OS_VERSION=${OS_VERSION:Q}                              \



Home | Main Index | Thread Index | Old Index