aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2016-05-13 02:20:27 +0800
committeremaste <emaste@FreeBSD.org>2016-05-13 02:20:27 +0800
commit0198d9e414a31ad4be2bc2df50ef9f7443fc2769 (patch)
treea0a77f5a3985a6375dcbedb549c32c83cbc16e9d /Mk
parent1203c0ff2831bce993027ac17d14ef6a44b39ed5 (diff)
downloadfreebsd-ports-gnome-0198d9e414a31ad4be2bc2df50ef9f7443fc2769.tar.gz
freebsd-ports-gnome-0198d9e414a31ad4be2bc2df50ef9f7443fc2769.tar.zst
freebsd-ports-gnome-0198d9e414a31ad4be2bc2df50ef9f7443fc2769.zip
Record TIMESTAMP in make makesum
This is intended to support development and prototyping for ports reproducible build efforts which require some concept of a "last updated" time. It is being committed now so that timestamp entries will be populated "for free" as port distfiles updates happen. Submitted by: bapt (earlier version) Reviewed by: bapt, bdrewery Approved by: portmgr (bdrewery) Differential Revision: https://reviews.freebsd.org/D6031
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk17
1 files changed, 13 insertions, 4 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index efcf09df8cdd..08540cd275d1 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -4161,7 +4161,11 @@ checksum_init=\
makesum: check-checksum-algorithms
@cd ${.CURDIR} && ${MAKE} fetch NO_CHECKSUM=yes \
DISABLE_SIZE=yes
- @if [ -f ${DISTINFO_FILE} ]; then ${CAT} /dev/null > ${DISTINFO_FILE}; fi
+ @if [ -f ${DISTINFO_FILE} ]; then \
+ if ${GREP} -q "^TIMESTAMP " ${DISTINFO_FILE}; then \
+ ${GREP} -v "^TIMESTAMP " ${DISTINFO_FILE} > ${DISTINFO_FILE}.sav; \
+ fi; \
+ fi
@( \
cd ${DISTDIR}; \
\
@@ -4172,11 +4176,16 @@ makesum: check-checksum-algorithms
eval alg_executable=\$$$$alg; \
\
if [ $$alg_executable != "NO" ]; then \
- $$alg_executable $$file >> ${DISTINFO_FILE}; \
+ $$alg_executable $$file >> ${DISTINFO_FILE}.new; \
fi; \
done; \
- ${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}; \
- done \
+ ${ECHO_CMD} "SIZE ($$file) = `${STAT} -f \"%z\" $$file`" >> ${DISTINFO_FILE}.new; \
+ done; \
+ if [ ! -f ${DISTINFO_FILE}.sav ] || ! cmp -s ${DISTINFO_FILE}.sav ${DISTINFO_FILE}.new; then \
+ ${ECHO_CMD} "TIMESTAMP = `date '+%s'`" > ${DISTINFO_FILE} ; \
+ ${CAT} ${DISTINFO_FILE}.new >> ${DISTINFO_FILE} ; \
+ fi ; \
+ rm -f ${DISTINFO_FILE}.new ${DISTINFO_FILE}.sav ; \
)
.endif