tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
print-PLIST and options
Hi every one. Some developers asked me to add PRINT_PLIST_AWK for
packages where I added option "nls". Idea is to simplify future updates
of such packages without "nls" breakages.
Personally, I think this approach is impractical for option "nls". In my
view it would be better to improve plist-PLIST output unconditionally,
not on per-package basis. Patch is below.
With this approach:
1) future package updates won't break this option
2) packages will semi-automatically obtain "nls" option,
especially new one.
Ideas?
Index: mk/plist/print-plist.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/plist/print-plist.mk,v
retrieving revision 1.36
diff -u -r1.36 print-plist.mk
--- mk/plist/print-plist.mk 10 Jun 2020 16:06:09 -0000 1.36
+++ mk/plist/print-plist.mk 6 May 2024 14:32:16 -0000
@@ -7,11 +7,18 @@
# - substitute for platform or package specifics substrings
#
# Usage:
-# - make install
+# - make build
+# - make do-install
# - make print-PLIST | brain >PLIST
#
# Keywords: plist print-plist
+# A list of pairs (regexp, option) for prefixing PLIST entry
+# with ${PLIST.<option>} if <regexp> matches it.
+_PRINT_PLIST_REGEXP_OPTION_LIST += \
+ ^man\/..(_..)?([.][[:alnum:]@-]*)?\/ nls \
+ ^share\/locale\/.*[.]mo$$ nls
+
_PRINT_PLIST_AWK_SUBST={
_PRINT_PLIST_AWK_SUBST+= \
gsub(/${PKGNAME_NOREV}/, "$${PKGNAME}"); \
@@ -21,6 +28,10 @@
gsub("^${PKGINFODIR}/", "info/"); \
gsub("^${PKGMANDIR}/", "man/");
+.for regexp option in ${_PRINT_PLIST_REGEXP_OPTION_LIST}
+_PRINT_PLIST_AWK_SUBST+= if (/${regexp}/) $$0 = "$${PLIST.${option}}" $$0;
+.endfor
+
_PRINT_PLIST_AWK_SUBST+=}
_PRINT_PLIST_AWK_IGNORE= ($$0 ~ /^${PKG_DBDIR:S|^${PREFIX}/||:S|/|\\/|g}\//)
Home |
Main Index |
Thread Index |
Old Index