Date: Sun, 7 Feb 2016 12:54:36 +0000 From: Matthew Seaman <matthew@FreeBSD.org> To: freebsd-questions@freebsd.org Cc: Ian Smith <smithi@nimnet.asn.au> Subject: Re: svn revision in uname Message-ID: <56B73E8C.5060501@FreeBSD.org> In-Reply-To: <20160207223554.P51785@sola.nimnet.asn.au> References: <20160207223554.P51785@sola.nimnet.asn.au>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1DhaDggq8t5KFSgFfPOBhr19Wk9VOVT0L Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 07/02/2016 12:11, Ian Smith wrote: > I've been using svnup for source updates for ages, and for my occasiona= l=20 > use it works fine. However one thing you don't get is the svn revision= =20 > shown in uname, eg % uname -vm > FreeBSD 9.3-STABLE #0: Thu Oct 29 03:18:26 EST 2015=20 > root@x200.smithi.id.au:/usr/obj/usr/src/sys/GENERIC amd64 >=20 > I know where to find it: > smithi@x200:~ % ll -rt /var/tmp/svnup/ > total 30400 > -rw-r--r-- 1 root wheel 3736967 Apr 22 2014 stable.apr > -rw-r--r-- 1 root wheel 3738448 Jun 25 2014 stable.jun > -rw-r--r-- 1 root wheel 3738347 Jul 6 2014 release > -rw-r--r-- 1 root wheel 7926790 Jan 23 2015 ports.first > -rw-r--r-- 1 root wheel 7927003 Jan 23 2015 ports > -rw-r--r-- 1 root wheel 3750256 Oct 10 16:43 stable >=20 > smithi@x200:~ % head -1 /var/tmp/svnup/stable > 289106 >=20 > but I don't know where to poke it so build|install world|kernel find it= ? >=20 > One of the reasons I prefer svnup on this very (64GB) space-constrained= =20 > laptop is that it doesn't need svn's extra copy of the repository, but = > I'm happy to add a /usr/src/.svn dir with whatever is needed for this. >=20 > Hoping the answer is not "the build needs svn installed to get that" :)= >=20 The place where this is all set up is /usr/src/sys/conf/newvers.sh The logic there is fairly complicated as it supports svn, git, hg and p4 VCSes. However, the usual way it works is by running svnversion -- that's part of the svn port. % svnversion /usr/src 295073M If that fails, it will try running svnliteversion, and then cycle through various different ways of extracting a version string from other VCSes until it gets a result. So, if you don't need SVN installed locally, you could create a small shell script as /usr/local/bin/svnversion that runs 'head -1 /var/tmp/svnup/stable' Cheers, Matthew --1DhaDggq8t5KFSgFfPOBhr19Wk9VOVT0L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2 iQJ8BAEBCgBmBQJWtz6NXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkAT1b4P/1rs1g4bv55uBWO2C8qlhYuR sTNmqYfsPlr2lHM2lVP6+Sr73PFUjDPjWDO5sVCAAUXKTuDU/Tpf8DRFFIp6pJkC ieLftv153aOmGJ1L687BfFnTBUoaZWJ2oFWzbxsbqDTfnF+15h261X3gD1iRjGa7 IroPeG1n5cjdqkjgRVlBk7LPgH5F9GDxbFtvJ3w9jWlfqoQV9E6arUkbnO1z0k+3 ZqUjxhor3A9eMM+Cm1uF7W6f9EDKDKlPEw4teyNftsvdHqGZXihvPs1shgIT4ar6 wk7fUSfK6RneT9YUlhey+K6aKxdzO30V/+Eym68uhrQDi/4d6sS/VrlimaZfj8z3 vax7FWuFas0iolymt7nJLmdv9E1ZexZOodXmISD7BHsKqNvdPQBFvt1zfWt8T2ES 7MuCKkYiOWPtKYK2u2Nrhu1k4hof21nHxR9Q2H5CUnOxJJN4m8Bg4TEExV4ujneA W5hxBc6CNR3GlwAexnVAlj13S0wVd/VU6i7feGhPphX4J1IGjDBhJaDQ6Z+XfhTc XHEpXQrM2YyR3bHhkU3tIUwCzH7M6k2fFZASMOAopspbmTyafwWt+zwvI2EjcPbC TCVXA8dhNcVs0VttG0R0STgr/1vAf/rIVrNxeDgXcrTLyjEONj3HpUBAM9JQ9Py9 e0abIrpMf04skEB4enYT =TPw9 -----END PGP SIGNATURE----- --1DhaDggq8t5KFSgFfPOBhr19Wk9VOVT0L--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56B73E8C.5060501>