From owner-freebsd-arch Thu Jan 31 10:33:46 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.yadt.co.uk (yadt.demon.co.uk [158.152.4.134]) by hub.freebsd.org (Postfix) with SMTP id 1FC1C37B419 for ; Thu, 31 Jan 2002 10:33:27 -0800 (PST) Received: (qmail 49583 invoked from network); 31 Jan 2002 18:33:23 -0000 Received: from unknown (HELO mail.gattaca.yadt.co.uk) (qmailr@10.0.0.2) by yadt.demon.co.uk with SMTP; 31 Jan 2002 18:33:23 -0000 Received: (qmail 61225 invoked by uid 1000); 31 Jan 2002 18:33:21 -0000 Date: Thu, 31 Jan 2002 18:33:21 +0000 From: David Taylor To: Josef Karthauser Cc: Nate Williams , Sheldon Hearn , Terry Lambert , arch@FreeBSD.ORG Subject: Re: Adding support for a global src tree serial number Message-ID: <20020131183321.GA59544@gattaca.yadt.co.uk> Mail-Followup-To: Josef Karthauser , Nate Williams , Sheldon Hearn , Terry Lambert , arch@FreeBSD.ORG References: <3C5944A4.4927F812@mindspring.com> <80628.1012484102@axl.seasidesoftware.co.za> <15449.30438.698921.182380@caddis.yogotech.com> <20020131173702.J77899@genius.tao.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <20020131173702.J77899@genius.tao.org.uk> User-Agent: Mutt/1.3.25i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 31 Jan 2002, Josef Karthauser wrote: > On Thu, Jan 31, 2002 at 09:55:02AM -0700, Nate Williams wrote: > > FWIW, this has been gone over many times in the past. We even had a > > workable solution, but unfortunately Richard W. (the originator of said > > feature request) refused to acknowledge the issues and propose a > > solution that would satisfy all problems. >=20 > This is mad! :) >=20 > The easiest solution is the one that I proposed in the PR, which is to > use the effective date of the latest date in the $FreeBSD$ files. > Of course this means going through each source file, but that's only > time. Doing anything with CVSROOT/ and cvsup, etc, is complexity that > isn't needed. The ircd-hybrid CVS repo is currently using a copy of the FreeBSD CVSROOT/ scripts (thanks for those! :), with various modifications to maintain the behaviour of the previous scripts. One modification I made was to create a (reverse order) ChangeLog file, (I added a 'POSTLOG_SUB($logfile)' config option, which, if the log name matched ($foo) =3D /(.*)\.tmp$/, would append "$foo" to "$foo.tmp" and rena= me it "$foo", but I'm sure there's a nicer way to do it). The other, was a commit 'serial number', in the format YYYYMMDD_, where is incremented by one for each commit, and reset to 0 each day. I did that by adding 'PRELOG_SUB($file, @text)' (Uhm, actually, I suspect that already exists, I just abused it) which (hackishly) also checks the logfile name against /.*\.tmp$/ to decide if it should do a serial number or not. Then it just determines the name of the serial file from the ChangeLog file (e.g. ircd-hybrid-7/ChangeLog -> ircd-hybrid-7/include/serno.h), and uses co -l/ci -mfoo to update the file, with some perl-foo to update the number inbetween, of course). It'd be easy(ish) to create a specific option to update a configurable serno for each repo, instead of overloading the log filename for everything. The file created by the script just looks like #define SERIALNUM "20020122_1" So the file is just #include'd where needed. I also added the serialnum to the commit mail. > l=3D`find /usr/src/sys | xargs grep '\$FreeBSD:.*$' | sed \ > 's/.*\$FreeBSD://' | awk '{ print $3 "-" $4 }' | sort -n | tail -1` That can take ages, and isn't necesarily correct if parts of src/ aren't present. I thought the idea was for a quickly obtainable number that can be included with PRs, and stored inside the kernel or whatever. --=20 David Taylor davidt@yadt.co.uk "The future just ain't what it used to be" --oyUTqETQ0mS9luUI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8WY3xfIqKXSsJ/xERAsSLAKDFaxViwo67NOEda+Lj9k9CnGDduwCgiblZ G8EJUhXn+SqfQbXdL+KZ0Lk= =10M7 -----END PGP SIGNATURE----- --oyUTqETQ0mS9luUI-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message