LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bryan Wu <bryan.wu@analog.com>
To: Sam Ravnborg <sam@ravnborg.org>, Frans Pop <elendil@planet.nl>
Cc: Bryan Wu <bryan.wu@analog.com>,
	akpm@linux-foundation.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH try#2 ] kbuild: add svn revision information to setlocalversion
Date: Sun, 03 Feb 2008 14:13:26 +0800	[thread overview]
Message-ID: <1202019206.6671.18.camel@roc-laptop> (raw)
In-Reply-To: <20080202213015.GA27015@uranus.ravnborg.org>

>From 0a7a2c6f19d32a85ca1a7887382325170ef19a66 Mon Sep 17 00:00:00 2001
From: Bryan Wu <bryan.wu@analog.com>
Date: Sun, 3 Feb 2008 14:05:00 +0800
Subject: [PATCH] [Scripts] add svn revision information to setlocalversion

follow git and mercurial style, include uncommitted changes detect

Cc: Frans Pop <elendil@planet.nl>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
 scripts/setlocalversion |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 scripts/setlocalversion

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
old mode 100644
new mode 100755
index 52f032e..1c1bdaf
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -45,3 +45,19 @@ if hgid=`hg id 2>/dev/null`; then
 	# All done with mercurial
 	exit
 fi
+
+# Check for svn and a svn repo.
+if rev=`svn info 2>/dev/null | grep '^Revision'`; then
+	rev=`echo $rev | awk '{print $NF}'`
+	changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
+
+	# Are there uncommitted changes?
+	if [ $changes != 0 ]; then
+		printf -- '-svn%s%s%s' "$rev" -dirty "$changes"
+	else
+		printf -- '-svn%s' "$rev"
+	fi
+
+	# All done with svn
+	exit
+fi
-- 
1.5.3.4


  parent reply	other threads:[~2008-02-03  6:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 20:35 [REVIEW for merge] kbuild updates including silence of section mismatch check Sam Ravnborg
2008-02-02 21:25 ` Frans Pop
2008-02-02 21:30   ` Sam Ravnborg
2008-02-03  3:30     ` Bryan Wu
2008-02-03  6:13     ` Bryan Wu [this message]
2008-02-03 10:04       ` [PATCH try#2 ] kbuild: add svn revision information to setlocalversion Sam Ravnborg
2008-02-02 22:37 ` [Additional PATCH] kbuild: do not warn about __*init/__*exit symbols being exported Sam Ravnborg
2008-02-05 10:38 ` [REVIEW for merge] kbuild updates including silence of section mismatch check Geert Uytterhoeven
2008-02-06 20:58   ` Sam Ravnborg

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=1202019206.6671.18.camel@roc-laptop \
    --to=bryan.wu@analog.com \
    --cc=akpm@linux-foundation.org \
    --cc=elendil@planet.nl \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --subject='Re: [PATCH try#2 ] kbuild: add svn revision information to setlocalversion' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).