Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 18:33:21 +0000
From:      David Taylor <davidt@yadt.co.uk>
To:        Josef Karthauser <joe@tao.org.uk>
Cc:        Nate Williams <nate@yogotech.com>, Sheldon Hearn <sheldonh@starjuice.net>, Terry Lambert <tlambert2@mindspring.com>, arch@FreeBSD.ORG
Subject:   Re: Adding support for a global src tree serial number
Message-ID:  <20020131183321.GA59544@gattaca.yadt.co.uk>
In-Reply-To: <20020131173702.J77899@genius.tao.org.uk>
References:  <3C5944A4.4927F812@mindspring.com> <80628.1012484102@axl.seasidesoftware.co.za> <15449.30438.698921.182380@caddis.yogotech.com> <20020131173702.J77899@genius.tao.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

--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_<n>, where
<n> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020131183321.GA59544>