summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2001-04-17 09:07:01 +0000
committeragc <agc@pkgsrc.org>2001-04-17 09:07:01 +0000
commitdc170907cccb4dcc48a60dbb512a891f6532a7c0 (patch)
tree3d129039f074509943f0e4684317c765d4406106 /mk
parent38dac5c2811a3e3926bed7ca1a66af9bd60cdde0 (diff)
downloadpkgsrc-dc170907cccb4dcc48a60dbb512a891f6532a7c0.tar.gz
Distinfo changes.
+ move the distfile digest/checksum value from files/md5 to distinfo + move the patch digest/checksum values from files/patch-sum to distinfo + include distfile filesizes in distinfo If there's no distinfo file (the name comes from FreeBSD, no point in being gratuitously incompatible), then use existing files/{md5,patch-sum} files.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk87
1 files changed, 41 insertions, 46 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 351fafb57f5..6d17fc32738 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.718 2001/04/16 00:55:37 tron Exp $
+# $NetBSD: bsd.pkg.mk,v 1.719 2001/04/17 09:07:01 agc Exp $
#
# This file is in the public domain.
#
@@ -268,8 +268,15 @@ DIGEST_ALGORITHM?= SHA1
# Miscellaneous overridable commands:
SHCOMMENT?= ${ECHO_MSG} >/dev/null '***'
+DISTINFO_FILE?= ${.CURDIR}/distinfo
+
+.if exists(${DISTINFO_FILE})
+DIGEST_FILE?= ${DISTINFO_FILE}
+PATCH_SUM_FILE?= ${DISTINFO_FILE}
+.else
DIGEST_FILE?= ${FILESDIR}/md5
PATCH_SUM_FILE?= ${FILESDIR}/patch-sum
+.endif
.if exists(/usr/bin/m4)
M4?= /usr/bin/m4
@@ -2469,70 +2476,58 @@ fetch-list-one-pkg:
.if !target(makesum)
makesum: fetch uptodate-digest
- ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${FILESDIR}
- ${_PKG_SILENT}${_PKG_DEBUG}if [ -f ${DIGEST_FILE} ]; then ${RM} -f ${DIGEST_FILE}; fi
- @${ECHO} -n "$$" > ${DIGEST_FILE}; \
- ${ECHO} -n "NetBSD" >> ${DIGEST_FILE}; \
- ${ECHO} "$$" >> ${DIGEST_FILE}; \
- ${ECHO} "" >> ${DIGEST_FILE}
- ${_PKG_SILENT}${_PKG_DEBUG}cd ${DISTDIR}; \
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ newfile=${DISTINFO_FILE}.$$$$; \
+ ${ECHO} -n "$$" > $$newfile; \
+ ${ECHO} -n "NetBSD" >> $$newfile; \
+ ${ECHO} "$$" >> $$newfile; \
+ ${ECHO} "" >> $$newfile; \
+ cd ${DISTDIR}; \
for sumfile in "" ${_CKSUMFILES}; do \
if [ "X$$sumfile" = "X" ]; then continue; fi; \
- ${DIGEST} ${DIGEST_ALGORITHM} $$sumfile >> ${DIGEST_FILE}; \
- done
- ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${DIGEST} ${DIGEST_ALGORITHM} $$sumfile >> $$newfile; \
+ ${LS} -l $$sumfile | ${AWK} '{ print "Size (" $$9 ") = " $$5 " bytes" }' >> $$newfile; \
+ done; \
for ignore in "" ${_IGNOREFILES}; do \
if [ "X$$ignore" = "X" ]; then continue; fi; \
- ${ECHO} "${DIGEST_ALGORITHM} ($$ignore) = IGNORE" >> ${DIGEST_FILE}; \
- done
+ ${ECHO} "${DIGEST_ALGORITHM} ($$ignore) = IGNORE" >> $$newfile; \
+ done; \
+ if [ -f ${PATCH_SUM_FILE} ]; then \
+ ${AWK} '$$2 ~ /\(patch-[a-z0-9]+\)/ { print $$0 }' < ${PATCH_SUM_FILE} >> $$newfile; \
+ fi; \
+ ${MV} $$newfile ${DISTINFO_FILE}
.endif
.if !target(makepatchsum)
makepatchsum mps: uptodate-digest
${_PKG_SILENT}${_PKG_DEBUG} \
- (${MKDIR} ${FILESDIR}; \
- ${ECHO_MSG} "${_PKGSRC_IN}> Making patch checksums"; \
- if [ -f "${PATCH_SUM_FILE}" ]; then \
- ${AWK} -- '{print ; exit}' < ${PATCH_SUM_FILE} > ${PATCH_SUM_FILE}.new; \
- else \
- ${ECHO} -n "$$" > ${PATCH_SUM_FILE}.new; \
- ${ECHO} -n "NetBSD" >> ${PATCH_SUM_FILE}.new; \
- ${ECHO} "$$" >> ${PATCH_SUM_FILE}.new; \
+ newfile=${DISTINFO_FILE}.$$$$; \
+ if [ -f ${DIGEST_FILE} ]; then \
+ ${AWK} '$$2 !~ /\(patch-[a-z0-9]+\)/ { print $$0 }' < ${DIGEST_FILE} >> $$newfile; \
fi; \
- ${ECHO} "" >> ${PATCH_SUM_FILE}.new; \
- havepatches=0; \
if [ -d ${PATCHDIR} ]; then \
- cd ${PATCHDIR}; \
+ (cd ${PATCHDIR}; \
for sumfile in "" patch-*; do \
if [ "X$$sumfile" = "X" ]; then continue; fi; \
if [ "X$$sumfile" = "Xpatch-*" ]; then break; fi; \
case $$sumfile in \
patch-local-*) ;; \
*.orig) continue ;; \
- *) ${ECHO} "${DIGEST_ALGORITHM} ($$sumfile) = `${SED} -e '/\$$NetBSD.*/d' $$sumfile | ${DIGEST} ${DIGEST_ALGORITHM}`" >> ${PATCH_SUM_FILE}.new; \
- havepatches=1 ;; \
+ *) ${ECHO} "${DIGEST_ALGORITHM} ($$sumfile) = `${SED} -e '/\$$NetBSD.*/d' $$sumfile | ${DIGEST} ${DIGEST_ALGORITHM}`" >> $$newfile;; \
esac; \
- done; \
+ done); \
fi; \
- if [ $$havepatches = 0 ]; then \
- if [ -f "${PATCH_SUM_FILE}" ]; then \
- ${ECHO} "This placeholder file is generated by the \`\`makepatchsum'' target" >> ${PATCH_SUM_FILE}.new; \
- ${ECHO} "whenever the patches directory is empty or missing. Its purpose" >> ${PATCH_SUM_FILE}.new; \
- ${ECHO} "is to ensure that the presence of any obsolete patches will cause" >> ${PATCH_SUM_FILE}.new; \
- ${ECHO} "the proper error to be emitted at build time." >> ${PATCH_SUM_FILE}.new; \
- ${ECHO_MSG} "=> placeholder patch-sum file created"; \
- else \
- ${RM} -f ${PATCH_SUM_FILE}.new; \
- ${ECHO_MSG} "=> no patch-sum file created"; \
- exit 0; \
- fi; \
- fi; \
- if cmp -s ${PATCH_SUM_FILE}.new ${PATCH_SUM_FILE}; then \
- ${RM} -f ${PATCH_SUM_FILE}.new; \
- ${ECHO_MSG} "=> patch-sum file unchanged"; \
- else \
- ${MV} ${PATCH_SUM_FILE}.new ${PATCH_SUM_FILE}; \
- fi)
+ ${MV} $$newfile ${DISTINFO_FILE}
+.endif
+
+# This target is done by invoking a sub-make so that DIGEST_FILE gets
+# re-evaluated after the "makepatchsum" target is made. This can be
+# made into:
+#makedistinfo mdi: makepatchsum makesum
+# once a combined distinfo file exists for all packages
+.if !target(makedistinfo)
+makedistinfo mdi distinfo: makepatchsum
+ ${_PKG_SILENT}${_PKG_DEBUG}${MAKE} makesum
.endif
.if !target(checksum)