From: Ryan Anderson <ryan@michonline.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Len Brown <len.brown@intel.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Versioning of tree
Date: Mon, 25 Oct 2004 19:47:36 -0400 [thread overview]
Message-ID: <20041025234736.GF10638@michonline.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0410200728040.2317@ppc970.osdl.org>
On Wed, Oct 20, 2004 at 07:33:47AM -0700, Linus Torvalds wrote:
> Personally, I much rather go the way we have gone, because I don't care
> about module versioning nearly as much as I care about bug-report
> versioning. And if I hear about a bug with 2.6.10-rc1, I want to know that
> it really is at _least_ 2.6.10-rc1, if you see what I mean..
Well, here's a patch that adds -BKxxxxxxxx to LOCALVERSION when a
top-level BitKeeper tree is detected.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
diff -Nru a/Makefile b/Makefile
--- a/Makefile 2004-10-25 19:45:55 -04:00
+++ b/Makefile 2004-10-25 19:45:55 -04:00
@@ -149,6 +149,12 @@
# careful not to include files twice if building in the source
# directory. LOCALVERSION from the command line override all of this
+ifeq ($(shell ls -d $(srctree)/BitKeeper 2>/dev/null),$(srctree)/BitKeeper)
+localversion-bk := $(shell perl $(srctree)/scripts/setlocalversion $(srctree) $(objtree))
+else
+localversion-bk :=
+endif
+
ifeq ($(objtree),$(srctree))
localversion-files := $(wildcard $(srctree)/localversion*)
else
@@ -157,6 +163,7 @@
LOCALVERSION = $(subst $(space),, \
$(shell cat /dev/null $(localversion-files)) \
+ $(subst ",,$(localversion-bk)) \
$(subst ",,$(CONFIG_LOCALVERSION)))
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)
diff -Nru a/scripts/setlocalversion b/scripts/setlocalversion
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/scripts/setlocalversion 2004-10-25 19:45:55 -04:00
@@ -0,0 +1,62 @@
+#!/usr/bin/perl
+# Copyright 2004 - Ryan Anderson <ryan@michonline.com> GPL v2
+
+use strict;
+use warnings;
+use Digest::MD5;
+require 5.006;
+
+if (@ARGV != 2) {
+ print <<EOT;
+Usage: setlocalversion <srctree> <objtree>
+EOT
+ exit(1);
+}
+
+my $debug = 0;
+
+my ($srctree,$objtree) = @ARGV;
+
+my @LOCALVERSIONS = ();
+
+# BitKeeper Version Checks
+
+# We are going to use the following commands to try and determine if
+# this repository is at a Version boundary (i.e, 2.6.10 vs 2.6.10 + some patches)
+# We currently assume that all meaningful version boundaries are marked by a tag.
+# We don't care what the tag is, just that something exists.
+
+#ryan@mythryan2 ~/dev/linux/local$ T=`bk changes -r+ -k`
+#ryan@mythryan2 ~/dev/linux/local$ bk prs -h -d':TAG:\n' -r$T
+
+sub do_bk_checks {
+ chdir($srctree);
+ my $changeset = `bk changes -r+ -k`;
+ chomp $changeset;
+ my $tag = `bk prs -h -d':TAG:' -r'$changeset'`;
+
+ printf("ChangeSet Key = '%s'\nTAG = '%s'\n", $changeset, $tag) if ($debug > 0);
+
+ if (length($tag) == 0) {
+ # We do not have a tag at the Top of Tree, so we need to generate a localversion file
+ # We'll use the given $changeset as input into this.
+ my $localversion = Digest::MD5::md5_hex($changeset);
+ $localversion = substr($localversion,0,8);
+
+ printf("localversion = '%s'\n",$localversion) if ($debug > 0);
+
+ push @LOCALVERSIONS, "BK" . $localversion;
+
+ }
+}
+
+
+if ( -d "BitKeeper" ) {
+ my $bk = `which bk`;
+ chomp $bk;
+ if (length($bk) != 0) {
+ do_bk_checks();
+ }
+}
+
+printf "-%s\n", join("-",@LOCALVERSIONS) if (scalar @LOCALVERSIONS > 0);
--
Ryan Anderson
sometimes Pug Majere
next prev parent reply other threads:[~2004-10-26 1:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-20 6:49 Versioning of tree Benjamin Herrenschmidt
2004-10-20 7:22 ` Len Brown
2004-10-20 14:33 ` Linus Torvalds
2004-10-21 1:38 ` Benjamin Herrenschmidt
2004-10-21 15:33 ` Måns Rullgård
2004-10-21 15:48 ` Linus Torvalds
2004-10-21 16:49 ` Jeff Garzik
2004-10-21 17:10 ` Linus Torvalds
2004-10-21 23:03 ` kbuild (was Re: Versioning of tree) Jeff Garzik
2004-10-30 23:34 ` Sam Ravnborg
2004-10-25 23:47 ` Ryan Anderson [this message]
2004-10-26 11:49 ` Versioning of tree David Vrabel
2004-10-26 12:26 ` Ryan Anderson
2004-10-26 12:58 ` David Vrabel
2004-10-26 19:08 ` Sam Ravnborg
2004-10-26 18:04 ` Ryan Anderson
2004-10-26 19:11 ` Ian Campbell
2004-10-27 8:38 ` Ryan Anderson
2004-10-27 11:37 ` Sam Ravnborg
2004-10-20 8:22 ` Jeff Garzik
2004-10-20 8:39 ` Benjamin Herrenschmidt
2004-10-20 10:36 ` Måns Rullgård
-- strict thread matches above, loose matches on Subject: below --
2004-10-20 18:27 Chuck Ebbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041025234736.GF10638@michonline.com \
--to=ryan@michonline.com \
--cc=benh@kernel.crashing.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.