LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Frans Pop <elendil@planet.nl>, Bryan Wu <bryan.wu@analog.com>
Cc: 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: Sat, 2 Feb 2008 22:30:15 +0100 [thread overview]
Message-ID: <20080202213015.GA27015@uranus.ravnborg.org> (raw)
In-Reply-To: <E1JLPrz-00059X-Sc@faramir.fjphome.nl>
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
>
> 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`
>
> 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.
next prev parent reply other threads:[~2008-02-02 21:30 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 [this message]
2008-02-03 3:30 ` Bryan Wu
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=20080202213015.GA27015@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@linux-foundation.org \
--cc=bryan.wu@analog.com \
--cc=elendil@planet.nl \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).