From owner-freebsd-ports Thu Aug 21 17:39:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA03955 for ports-outgoing; Thu, 21 Aug 1997 17:39:28 -0700 (PDT) Received: from itojun.csl.sony.co.jp (root@itojun.csl.sony.co.jp [133.138.1.134]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA03950 for ; Thu, 21 Aug 1997 17:39:13 -0700 (PDT) From: itojun@itojun.org Received: from localhost (itojun@localhost [127.0.0.1]) by itojun.csl.sony.co.jp (8.8.5/3.3W3) with ESMTP id JAA01285; Fri, 22 Aug 1997 09:38:53 +0900 (JST) To: Bill Fenner Cc: freebsd-ports@freebsd.org Subject: Re: Versioning bsd.port.mk X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 References: <97Aug21.134334pdt.177512@crevenia.parc.xerox.com> In-reply-to: Bill Fenner 's message of Thu, 21 Aug 1997 13:43:22 PDT. <97Aug21.134334pdt.177512@crevenia.parc.xerox.com> X-Mailer: comp (MHng project) version 1997/08/04 03:38:46, by Jun-ichiro Itoh MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-ID: Date: Fri, 22 Aug 1997 09:38:51 +0900 Message-ID: <1280.872210331@itojun.csl.sony.co.jp> Sender: owner-freebsd-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Adding the following to bsd.port.mk will give you a variable which is >the check-in date of the existing bsd.port.mk (this doesn't help people >who have their own CVS trees into which they check FreeBSD sources). >BSD_PORT_MK_DATE= $$Date: $$ >BSD_PORT_MK_DATE:= ${BSD_PORT_MK_DATE:M[0-9]*/[0-9]*} >BSD_PORT_MK_DATE:= ${BSD_PORT_MK_DATE:S/\///g} >Then bsd.port.mk could have something like >.if defined(NEED_MK_VERSION) && (${NEED_MK_VERSION} > ${BSD_PORT_MK_DATE}) > ${ECHO_MSG} "===> WARNING: you probably need a newer bsd.port.mk to build this port" >.endif >in bsd.port.mk, and port Makefiles could contain NEED_MK_VERSION= . how about this? (using perl is not essential; I'm happy with the above Makefile-only approach) itojun ======= --- bsd.port.mk Tue Aug 19 21:32:50 1997 +++ /tmp/bsd.port.mk Wed Aug 20 14:03:02 1997 @@ -390,6 +389,7 @@ MD5?= md5 .endif MD5_FILE?= ${FILESDIR}/md5 +STAMP_FILE?= ${FILESDIR}/stamp MAKE_FLAGS?= -f MAKEFILE?= Makefile @@ -814,6 +814,12 @@ @${DO_NADA} .endif +.if defined(NO_CHECKSTAMP) && !target(checkstamp) +checkstamp: fetch + @${DO_NADA} +.endif + + # Disable extract .if defined(NO_EXTRACT) && !target(extract) extract: checksum @@ -1174,7 +1180,7 @@ ################################################################ .if !target(fetch) -fetch: +fetch: checkstamp @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-fetch .endif @@ -1357,6 +1363,14 @@ done .endif +.if !target(makestamp) +makestamp: + @${MKDIR} ${FILESDIR} + @if [ -f ${STAMP_FILE} ]; then ${RM} -f ${STAMP_FILE}; fi + @grep 'Id: bsd.port.mk,v' /usr/share/mk/bsd.port.mk | head -1 | \ + perl -pe 's/.*(\d\d\d\d)\/(\d\d)\/(\d\d) (\d\d):(\d\d):(\d\d).*/$$1$$2$$3$$4/' > ${STAMP_FILE} +.endif + .if !target(checksum) checksum: fetch @if [ ! -f ${MD5_FILE} ]; then \ @@ -1399,6 +1413,23 @@ fi) ; \ fi .endif + +.if !target(checkstamp) +checkstamp: + @if [ ! -f ${STAMP_FILE} ]; then \ + ${ECHO_MSG} ">> No bsd.port.mk timestamp file."; \ + else ( \ + CURSTAMP=`grep 'Id: bsd.port.mk,v' /usr/share/mk/bsd.port.mk | head -1 | perl -pe 's/.*(\d\d\d\d)\/(\d\d)\/(\d\d) (\d\d):(\d\d):(\d\d).*/$$1$$2$$3$$4/'`; \ + EXPECTEDSTAMP=`cat ${STAMP_FILE}`; \ + if [ "$$CURSTAMP" -lt "$$EXPECTEDSTAMP" ]; then \ + ${ECHO_MSG} "bsd.port.mk looks older than expected."; \ + ${ECHO_MSG} "If you wish to force make the port, type"; \ + ${ECHO_MSG} "\"make NO_CHECKSTAMP=yes [other args]\"."; \ + exit 1; \ + fi ); \ + fi +.endif + ################################################################ # The special package-building targets