From: Frans Pop <elendil@planet.nl>
To: Sam Ravnborg <sam@ravnborg.org>
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, 02 Feb 2008 22:25:51 +0100 [thread overview]
Message-ID: <E1JLPrz-00059X-Sc@faramir.fjphome.nl> (raw)
In-Reply-To: <20080202203503.GA26415@uranus.ravnborg.org>
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:26 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 [this message]
2008-02-02 21:30 ` Sam Ravnborg
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=E1JLPrz-00059X-Sc@faramir.fjphome.nl \
--to=elendil@planet.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®