From owner-freebsd-ports Fri Mar 26 5:49:48 1999 Delivered-To: freebsd-ports@freebsd.org Received: from stampede.cs.berkeley.edu (stampede.CS.Berkeley.EDU [128.32.45.124]) by hub.freebsd.org (Postfix) with ESMTP id 493C714C10 for ; Fri, 26 Mar 1999 05:49:43 -0800 (PST) (envelope-from asami@cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca4-40.ix.netcom.com [205.186.212.168]) by stampede.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id FAA06188; Fri, 26 Mar 1999 05:49:14 -0800 (PST) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.9.2/8.6.9) id FAA18790; Fri, 26 Mar 1999 05:48:50 -0800 (PST) Date: Fri, 26 Mar 1999 05:48:50 -0800 (PST) Message-Id: <199903261348.FAA18790@silvia.hip.berkeley.edu> X-Authentication-Warning: silvia.hip.berkeley.edu: asami set sender to asami@cs.berkeley.edu using -f To: sjr@home.net Cc: jim@corp.au.triax.com, jorbeton@pilot.net, freebsd-ports@FreeBSD.ORG In-reply-to: <199903261302.IAA19553@istari.home.net> (sjr@home.net) Subject: Re: CVSup and Fetch From: asami@FreeBSD.ORG (Satoshi Asami) References: <199903261302.IAA19553@istari.home.net> Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * From: "Stephen J. Roznowski" * Would it be possible to inbed something in the bsd.port.mk file about * this? [So when it fails, it says to make sure you have a current upgrade * kit or some such] I've been thinking about it for quite awhile. :) How about something like this? A file (/var/db/pkg/VERSION) records the "version" of the system. The "version" is a number derived by concatenating the year/month/date -- so it's "19990326" today. If the "version" is too old, bsd.port.mk refuses to do anything. bsd.port.mk has a variable that contains the required version. When I know there is an incompatible update, I'll change the BSDPORTMKVERSION line. There are a couple ways to update the version file. An upgrade kit will of course fix it. Also, a "make world" will change it from within src/share/mk/Makefile. This will be the date of the install, not the date of the source, so it's actually possible that people can still trip over by doing a new install on an old source tree...but the alternative will be to encode something inside the source tree, which I do not want to start doing again. Sample patch follows. You can see the change to 31upgrade/Makefile too. 31upgrade/pkg/INSTALL just does a echo %%VERSION%% > /var/db/pkg/VERSION Satoshi P.S. Credit goes to billf for some of the ideas. === Index: src/share/mk/Makefile =================================================================== RCS file: /usr/cvs/src/share/mk/Makefile,v retrieving revision 1.21 diff -u -r1.21 Makefile --- Makefile 1998/11/11 05:21:26 1.21 +++ Makefile 1999/03/26 13:15:43 @@ -13,4 +13,7 @@ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${SHAREMODE} ${FILES} \ ${DESTDIR}${BINDIR}/mk +afterinstall: + date '+%Y%m%d' > /var/db/pkg/VERSION + .include Index: ports/Mk/bsd.port.mk =================================================================== RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.307 diff -u -r1.307 bsd.port.mk --- bsd.port.mk 1999/03/09 11:27:34 1.307 +++ bsd.port.mk 1999/03/26 13:29:35 @@ -1134,6 +1128,8 @@ # Don't build a port on an ELF machine if it's broken for ELF. # # Don't build a port if it's broken. +# +# Don't build a port if the system is too old. ################################################################ OLDSYSTCL!= ${ECHO} /usr/include/tcl.h /usr/lib/libtcl??.so.*.* @@ -1153,6 +1149,18 @@ .endfor .endif +# You need an upgrade kit or make world newer than this +BSDPORTMKVERSION= 19990326 +VERSIONFILE= ${PKG_DBDIR}/VERSION +.if exists(${VERSIONFILE}) +SYSTEMVERSION!= cat ${VERSIONFILE} +.else +SYSTEMVERSION= 0 +.endif +.if ${BSDPORTMKVERSION} > ${SYSTEMVERSION} +IGNORE= ": Your system is too old. You need a fresh make world or an upgrade kit. Please go to http://www.freebsd.org/ports/ or a mirror site and follow the instructions" +.endif + .if defined(ONLY_FOR_ARCHS) .for __ARCH in ${ONLY_FOR_ARCHS} .if ${MACHINE_ARCH:M${__ARCH}} != "" Index: ports/misc/31upgrade/Makefile =================================================================== RCS file: /usr/cvs/ports/misc/31upgrade/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 1999/03/10 22:10:51 1.3 +++ Makefile 1999/03/26 13:35:49 @@ -22,6 +22,10 @@ NO_MTREE= yes PREFIX= / NO_BUILD= yes -NO_INSTALL= yes +PKGINSTALL= ${WRKDIR}/INSTALL + +do-install: + ${SED} -e "s/%%VERSION%%/${BSDPORTMKVERSION}/" ${PKGDIR}/INSTALL \ + > ${PKGINSTALL} .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message