From owner-freebsd-ports Sun May 2 6:54: 9 1999 Delivered-To: freebsd-ports@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 6E99C14C59 for ; Sun, 2 May 1999 06:54:05 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id PAA15914 for ; Sun, 2 May 1999 15:54:04 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id PAA32731 for ports@freebsd.org; Sun, 2 May 1999 15:54:04 +0200 (MET DST) Date: Sun, 2 May 1999 15:54:03 +0200 From: Eivind Eklund To: ports@freebsd.org Subject: Possible bsd.port.mk addition Message-ID: <19990502155403.A29201@bitbox.follo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I just found myself about to hack on the code for a port, and setting up a cvs repository for it in order to be able to work in a reasonably comfortable environment. After I was finished with my hacking (I ended up with just doing a minor patch; it was less work than I'd anticipated) it struck me that this could easily be automated and would probably be useful. Below is a simple patch to automatically create a cvs repository and check out from it from the hopefully relevant part of the port: Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.311 diff -u -r1.311 bsd.port.mk --- bsd.port.mk 1999/04/28 06:20:12 1.311 +++ bsd.port.mk 1999/05/02 13:48:38 @@ -2439,6 +2439,22 @@ fi .endif +.if !target(cvs) +cvs: ${EXTRACT_COOKIE} + @if [ -e ${PATCH_COOKIE} ]; then \ + echo "Cannot make cvs repo after patching;" \ + "'make clean' and try again'" ; \ + exit 1 ; \ + fi + @(export CVSROOT=${.OBJDIR}/repo ; \ + if [ ! -e $${CVSROOT} ]; then \ + cvs -d $${CVSROOT} init ; \ + fi ; \ + (cd ${WRKSRC} && cvs -d $${CVSROOT} import -m'Clean import' src \ + FOO V`date -u +%Y%m%d%H%M%S`); \ + cvs -d $${CVSROOT} checkout src) +.endif + # Depend is generally meaningless for arbitrary ports, but if someone wants # one they can override this. This is just to catch people who've gotten into # the habit of typing `make depend all install' as a matter of course. There are a lot of improvements that could be made beyond this simple patch; it would, for instance, be nice to be able to use the repo or src area as the "distfile" instead of using the tarball (but you'd want to be able use the tarball, too, in order to be able to import new versions). I've not gone into those areas; I expect the members of the ports list to have more experience with different ports than I do, and thus be more easily able to judge what they want in order to work efficiently. Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message