From owner-freebsd-current@FreeBSD.ORG Tue Aug 10 21:31:02 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11194106564A; Tue, 10 Aug 2010 21:31:02 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 95F1E8FC15; Tue, 10 Aug 2010 21:31:01 +0000 (UTC) Received: by vws7 with SMTP id 7so9544262vws.13 for ; Tue, 10 Aug 2010 14:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:openpgp :content-type:content-transfer-encoding; bh=HZjRsKTnbyyxNIN2mGDp9CNMkURCt3enxjOOeQvyrzc=; b=D6nkFM4sa/BZUxnomwInxkzwvmajwfcYJqlW5rEAKHFcJE5ZgajOEiurX7JspBzjou 82+wIxtEEvfRZvx/XUMGGcolnNga7PzYHMrkTgxqYQbSGpXxjv2Uqaij4v6VqYgHspCJ AVlisI5UWLjXQMcFKi3HojqNNGXuzhvA91rJg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=YVNyD8eJ9qwQ4ftEYRrckqQAz2zJaG0TwlCSkfa5Yc0OjlYoNQBy090etemyr6g9Cs taobVbl2pEi+PbQQYb/167bPEEHg04qOnTqaWBbPfJpjOP0Umcpf9FCqM/wFQREg9RH+ teRKlttpjFL2sU5vzBCZlF1YwPTHmPK2YJWyk= Received: by 10.220.61.9 with SMTP id r9mr10849326vch.123.1281475857916; Tue, 10 Aug 2010 14:30:57 -0700 (PDT) Received: from centel.dataix.local (adsl-99-19-46-227.dsl.klmzmi.sbcglobal.net [99.19.46.227]) by mx.google.com with ESMTPS id w6sm804825vcj.3.2010.08.10.14.30.56 (version=SSLv3 cipher=RC4-MD5); Tue, 10 Aug 2010 14:30:56 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4C61C50E.8040900@dataix.net> Date: Tue, 10 Aug 2010 17:30:54 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100806 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: FreeBSD Stable , FreeBSD Current X-Enigmail-Version: 1.1.2 OpenPGP: id=89D8547E Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: [CFT] [sys/conf/newvers.sh] Cleanup and additions. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 21:31:02 -0000 Hello Stablers & Heads, Based on the parts of the script with the additions for tracking source using git(1) I set out to add support for mercurial hg(1) and ended up cleaning some of the script while making some of those additions. This works exactly as before but a little more correct and with the additions to be able to track kernel sources or whole source tree with a local revision system. Example output follows (uname -v) from my system being tracked locally with mercurial. FreeBSD 8.1-STABLE #0 r211092M 55:65408c40b051 Mon Aug 9 07:03:32 EDT 2010 jhell@ujump.dataix.net:/usr/obj/usr/src/sys/MITHOP Inspiration for making these changes came from mercurial, OpenSolaris and finally http://wiki.freebsd.org/LocalMercurial Following is a list of changes that I have made that I believe people that are involved with the source may find useful. 1 file changed, 55 insertions(+), 35 deletions(-) This allows a user: * That is using csup(1) or cvsup(1) to locally keep track of the whole source tree or just the kernel part of the tree using svn(1), hg(1) or git(1). * That is using svn(1) to checkout their source tree to use hg(1) or git(1) to keep track of the whole tree or the kernel part of the tree. http://svn.freebsd.org/base/ * That is using git(1) to checkout their source tree to use hg(1) to keep track of the whole tree or the kernel part of the tree. http://spoerlein.net/gitweb/ This checks for: * SCM roots in src/ or src/sys for .svn, .hg, & .git and acts accordingly if they exist while prioritizing using an SCM root in src/ before it uses src/sys/ * Then looks for acceptable binaries for svn(1), hg(1) git(1) within the select paths /usr/local/bin & then /usr/bin. The paths may change for svn(1) or git(1) & maybe mercurial if it ever becomes part of world. Currently I have set these to only look in /usr/local/bin. Cleanups: * Instead of using variables that shared the same name as their counterpart binaries to hold a revision number use more descriptive names like svnrev gitrev & hgrev for revisions. Use git svnversion & hg variables for their respective binaries. * Adjust the paths that are checked for binaries to be of only /usr/local/bin and /usr/bin. "/bin" is highly unlikely to hold svn(1), git(1) or hg(1). * Test for a SCM root in the source tree locations before we look for binaries. If these don't exist there is no need to know where svn or git are. * For git(1) always set work-tree and git-dir so there is no possibility to end up with a "-dirty" git(1) revision. * Remove extraneous "touch version" since the previous if statement already creates the file if its not found. * Inline the test for version file. I have opened a PR: misc/149510 here: http://bit.ly/buBqXc And have uploaded the patch here: http://bit.ly/9hvVfx Throw me some feedback, concerns or other information. It will be really appreciated. Regards, -- jhell,v