From owner-svn-ports-head@freebsd.org Thu May 12 18:20:28 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C11A2B38724; Thu, 12 May 2016 18:20:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C88F1D16; Thu, 12 May 2016 18:20:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4CIKRln004028; Thu, 12 May 2016 18:20:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4CIKROJ004026; Thu, 12 May 2016 18:20:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201605121820.u4CIKROJ004026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 May 2016 18:20:27 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r415078 - in head: . Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2016 18:20:29 -0000 Author: emaste (src committer) Date: Thu May 12 18:20:27 2016 New Revision: 415078 URL: https://svnweb.freebsd.org/changeset/ports/415078 Log: 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 Modified: head/CHANGES head/Mk/bsd.port.mk Modified: head/CHANGES ============================================================================== --- head/CHANGES Thu May 12 17:59:43 2016 (r415077) +++ head/CHANGES Thu May 12 18:20:27 2016 (r415078) @@ -22,6 +22,16 @@ AUTHOR: mat@FreeBSD.org WANT_BDB_VER=XX should be replaced by USES=bdb:XX. +20160512: +AUTHOR: emaste@FreeBSD.org + + "make makesum" now writes the current timestamp to distinfo when it is run. + This is done to support development and prototyping efforts for reproducible + package builds, which require some concept of a "last updated" time. + + The TIMESTAMP can currently be ignored for ports that have no distinfo, and + for updates done without using "make makesum." + 20160414: AUTHOR: mat@FreeBSD.org Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Thu May 12 17:59:43 2016 (r415077) +++ head/Mk/bsd.port.mk Thu May 12 18:20:27 2016 (r415078) @@ -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