LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bryan Wu <bryan.wu@analog.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Frans Pop <elendil@planet.nl>, Bryan Wu <bryan.wu@analog.com>,
akpm@linux-foundation.org, linux-kbuild@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [REVIEW for merge] kbuild updates including silence of section mismatch check
Date: Sun, 03 Feb 2008 11:30:29 +0800 [thread overview]
Message-ID: <1202009429.6671.2.camel@roc-laptop> (raw)
In-Reply-To: <20080202213015.GA27015@uranus.ravnborg.org>
On Sat, 2008-02-02 at 22:30 +0100, Sam Ravnborg wrote:
> Bryan this was from you - please comment/fix.
>
> Sam
>
> On Sat, Feb 02, 2008 at 10:25:51PM +0100, Frans Pop wrote:
> > Sam Ravnborg wrote:
> > > --- a/scripts/setlocalversion
> > > +++ b/scripts/setlocalversion
> > > @@ -45,3 +45,18 @@ 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' | awk '{print $NF}'` ; then
> > > + 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
> >
> > This looks broken. Unless I'm very much mistaken the 'if' statement is
> > always going to be true because the awk statement will always execute
> > without error. Try: echo "" | awk '{print $NF}' || echo Error
> >
You are right, it will always plus a '-svn' string at the end of kernel
version string even if it is not a svn repo.
> > So, the code should probably be changed to:
> > +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`
> >
I prefer to this one. A updated version will be sent out soon.
> > or alternatively:
> > +if rev=`svn info 2>/dev/null | grep '^Revision' | awk '{print $NF}'` && \
> > + [ -n "$rev" ] ; then
> > + changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
> >
> > Cheers,
> > FJP
> >
> > P.S. Looks like the mercurial section is missing some indentation.
I will fix this, too.
Regards,
-Bryan Wu
next prev parent reply other threads:[~2008-02-03 3:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 20:35 Sam Ravnborg
2008-02-02 21:25 ` Frans Pop
2008-02-02 21:30 ` Sam Ravnborg
2008-02-03 3:30 ` Bryan Wu [this message]
2008-02-03 6:13 ` [PATCH try#2 ] kbuild: add svn revision information to setlocalversion Bryan Wu
2008-02-03 10:04 ` 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=1202009429.6671.2.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: [REVIEW for merge] kbuild updates including silence of section mismatch check' \
/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).