pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   joerg
Date:           Sun Jan 12 23:38:42 UTC 2020

Modified Files:
        pkgsrc/mk/defaults: mk.conf
        pkgsrc/mk/pkgformat/pkg: metadata.mk pkgformat-vars.mk

Log Message:
Add USE_PKG_ADMIN_DIGEST flag for switching between $NetBSD$ and SHA256
digests to identify file versions. Defaults to no for now. For digest
mode, recursive into FILESDIR, so that e.g. the majority of pkg_install
itself is recorded as well SMF manifests.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 pkgsrc/mk/defaults/mk.conf
cvs rdiff -u -r1.17 -r1.18 pkgsrc/mk/pkgformat/pkg/metadata.mk
cvs rdiff -u -r1.7 -r1.8 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/defaults/mk.conf
diff -u pkgsrc/mk/defaults/mk.conf:1.305 pkgsrc/mk/defaults/mk.conf:1.306
--- pkgsrc/mk/defaults/mk.conf:1.305    Sat Jun  8 19:51:38 2019
+++ pkgsrc/mk/defaults/mk.conf  Sun Jan 12 23:38:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.305 2019/06/08 19:51:38 leot Exp $
+# $NetBSD: mk.conf,v 1.306 2020/01/12 23:38:42 joerg Exp $
 #
 
 # This file provides default values for variables that may be overridden
@@ -22,6 +22,12 @@ USE_CWRAPPERS?=      auto
 # Possible: yes, no, auto
 # Default: auto (automatic detection, see above)
 
+USE_PKG_ADMIN_DIGEST=  no
+# Record file digests instead of extracing the NetBSD RCS ID from files.
+#
+# Possible: yes, no
+# Default: no
+
 #ALLOW_VULNERABLE_PACKAGES=
 # allow the user to build packages which are known to be vulnerable to
 # security exploits

Index: pkgsrc/mk/pkgformat/pkg/metadata.mk
diff -u pkgsrc/mk/pkgformat/pkg/metadata.mk:1.17 pkgsrc/mk/pkgformat/pkg/metadata.mk:1.18
--- pkgsrc/mk/pkgformat/pkg/metadata.mk:1.17    Tue Oct  1 13:01:02 2019
+++ pkgsrc/mk/pkgformat/pkg/metadata.mk Sun Jan 12 23:38:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.17 2019/10/01 13:01:02 jperkin Exp $
+# $NetBSD: metadata.mk,v 1.18 2020/01/12 23:38:42 joerg Exp $
 
 ######################################################################
 ### The targets below are all PRIVATE.
@@ -129,13 +129,16 @@ ${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS
 ###
 _BUILD_VERSION_FILE=   ${PKG_DB_TMPDIR}/+BUILD_VERSION
 _METADATA_TARGETS+=    ${_BUILD_VERSION_FILE}
-
+.if !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss])
 ${_BUILD_VERSION_FILE}:
        ${RUN}${MKDIR} ${.TARGET:H}
        ${RUN}${RM} -f ${.TARGET}.tmp
        ${RUN}                                                          \
        exec 1>>${.TARGET}.tmp;                                         \
-       for f in ${.CURDIR}/Makefile ${FILESDIR}/* ${PKGDIR}/*; do      \
+       ${FIND} ${FILESDIR} -type f 2> /dev/null | while read f; do     \
+               ${TEST} ! -f "$$f" || ${ECHO} "$$f";                    \
+       done
+       for f in ${.CURDIR}/Makefile ${PKGDIR}/*; do                    \
                ${TEST} ! -f "$$f" || ${ECHO} "$$f";                    \
        done
        ${RUN}                                                          \
@@ -158,7 +161,45 @@ ${_BUILD_VERSION_FILE}:
        done
        ${RUN}                                                          \
        ${CAT} ${.TARGET}.tmp |                                         \
+       ${AWK} '{ t=$$0; sub("^${PKGSRCDIR}/", "");                     \
+                  printf "%s %s\n", t, $$0 }' |                        \
+       while read file relfile; do                                     \
+               printf "%s: " "$$relfile";                              \
+               ${PKG_ADMIN} digest "$$file";                           \
+       done |                                                          \
+       ${SORT} -u > ${.TARGET} && ${RM} -f ${.TARGET}.tmp
+.else
+${_BUILD_VERSION_FILE}:
+       ${RUN}${MKDIR} ${.TARGET:H}
+       ${RUN}${RM} -f ${.TARGET}.tmp
+       ${RUN}                                                          \
+       exec 1>>${.TARGET}.tmp;                                         \
+       for f in ${.CURDIR}/Makefile ${FILESDIR}/* ${PKGDIR}/*; do      \
+               ${TEST} ! -f "$$f" || ${ECHO} "$$f";                    \
+       done
+       ${RUN}                                                          \
+       exec 1>>${.TARGET}.tmp;                                         \
+       ${TEST} -f ${DISTINFO_FILE:Q} || exit 0;                        \
+       ${CAT} ${DISTINFO_FILE} |                                       \
+       ${AWK} 'NF == 4 && $$3 == "=" { gsub("[()]", "", $$2); print $$2 }' | \
        while read file; do                                             \
+               ${TEST} ! -f "${PATCHDIR}/$$file" ||                    \
+                       ${ECHO} "${PATCHDIR}/$$file";                   \
+       done
+       ${RUN}                                                          \
+       exec 1>>${.TARGET}.tmp;                                         \
+       ${TEST} -d ${PATCHDIR} || exit 0;                               \
+       cd ${PATCHDIR}; for f in *; do                                  \
+               case "$$f" in                                           \
+               "*"|*.orig|*.rej|*~)    ;;                              \
+               patch-*)                ${ECHO} "${PATCHDIR}/$$f" ;;    \
+               esac;                                                   \
+       done
+       ${RUN}                                                          \
+       ${CAT} ${.TARGET}.tmp |                                         \
+       ${AWK} '{ t=$$0; sub("^${PKGSRCDIR}/", "");
+                  printf "%s %s\n"; t, $$0 }' | \
+       while read file relfile; do                                     \
                ${GREP} '\$$NetBSD' $$file 2>/dev/null |                \
                ${SED} -e "s|^|$$file:|;q";                             \
        done |                                                          \
@@ -167,6 +208,7 @@ ${_BUILD_VERSION_FILE}:
                  sub("[$$][^$$]*$$", "$$");                            \
                  print; }' |                                           \
        ${SORT} -u > ${.TARGET} && ${RM} -f ${.TARGET}.tmp
+.endif
 
 ######################################################################
 ###

Index: pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
diff -u pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.7 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.8
--- pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.7       Sat Aug 19 00:30:19 2017
+++ pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk   Sun Jan 12 23:38:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: pkgformat-vars.mk,v 1.7 2017/08/19 00:30:19 jlam Exp $
+# $NetBSD: pkgformat-vars.mk,v 1.8 2020/01/12 23:38:42 joerg Exp $
 #
 # This Makefile fragment is included indirectly by bsd.prefs.mk and
 # defines some variables which must be defined earlier than where
@@ -32,8 +32,11 @@ PKG_INFO_CMD?=               ${PKG_TOOLS_BIN}/pkg_inf
 LINKFARM_CMD?=         ${PKG_TOOLS_BIN}/linkfarm
 
 # Latest versions of tools required for correct pkgsrc operation.
+.if !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss])
+PKGTOOLS_REQD=         20191008
+.else
 PKGTOOLS_REQD=         20100914
-
+.endif
 # Latest version of pkg_install required to extract packages
 PKGTOOLS_VERSION_REQD= 20091115
 



Home | Main Index | Thread Index | Old Index