From owner-freebsd-questions@freebsd.org Sun Feb 7 15:35:19 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4E0AA0240 for ; Sun, 7 Feb 2016 15:35:19 +0000 (UTC) (envelope-from c.brinkhaus@t-online.de) Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CCA795 for ; Sun, 7 Feb 2016 15:35:18 +0000 (UTC) (envelope-from c.brinkhaus@t-online.de) Received: from fwd27.aul.t-online.de (fwd27.aul.t-online.de [172.20.26.132]) by mailout10.t-online.de (Postfix) with SMTP id 2D829306F14; Sun, 7 Feb 2016 16:35:10 +0100 (CET) Received: from esprimo.local (Tz8AbyZ1QhCpx5unB7qvHwszP09Bzk-Qv68BfwIgUxGUhawL3VlVybiScvwofTMZad@[217.81.151.36]) by fwd27.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1aSRMh-0Ms5DM0; Sun, 7 Feb 2016 16:35:07 +0100 Received: from esprimo.local (localhost [127.0.0.1]) by esprimo.local (Postfix) with ESMTP id 7EC3745E477; Sun, 7 Feb 2016 16:35:05 +0100 (CET) Received: (from chris@localhost) by esprimo.local (8.15.2/8.15.2/Submit) id u17FZ5bU006204; Sun, 7 Feb 2016 16:35:05 +0100 (CET) (envelope-from chris) Date: Sun, 7 Feb 2016 16:35:05 +0100 From: Christoph Brinkhaus To: freebsd-questions@freebsd.org Cc: Ian Smith Subject: Re: svn revision in uname Message-ID: <20160207153505.GA1420@esprimo.local> References: <20160207223554.P51785@sola.nimnet.asn.au> <56B73E8C.5060501@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56B73E8C.5060501@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-ID: Tz8AbyZ1QhCpx5unB7qvHwszP09Bzk-Qv68BfwIgUxGUhawL3VlVybiScvwofTMZad X-TOI-MSGID: 5a7b7ea4-1c95-4d8b-9059-344898a3b81b X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 15:35:19 -0000 On Sun, Feb 07, 2016 at 12:54:36PM +0000, Matthew Seaman wrote: > On 07/02/2016 12:11, Ian Smith wrote: > > I've been using svnup for source updates for ages, and for my occasional > > use it works fine. However one thing you don't get is the svn revision > > shown in uname, eg % uname -vm > > FreeBSD 9.3-STABLE #0: Thu Oct 29 03:18:26 EST 2015 > > root@x200.smithi.id.au:/usr/obj/usr/src/sys/GENERIC amd64 > > > > 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 > > > > smithi@x200:~ % head -1 /var/tmp/svnup/stable > > 289106 > > > > but I don't know where to poke it so build|install world|kernel find it? > > > > One of the reasons I prefer svnup on this very (64GB) space-constrained > > 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. > > > > Hoping the answer is not "the build needs svn installed to get that" :) > > > > 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. The version svnlite is part of the system and does not need to be installed separately. Here svnliteversion /usr/src works. > > 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 Thank you, Matthew. Kind regards, Christoph