lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1202009429.6671.2.camel@roc-laptop>
Date:	Sun, 03 Feb 2008 11:30:29 +0800
From:	Bryan Wu <bryan.wu@...log.com>
To:	Sam Ravnborg <sam@...nborg.org>
Cc:	Frans Pop <elendil@...net.nl>, Bryan Wu <bryan.wu@...log.com>,
	akpm@...ux-foundation.org, linux-kbuild@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [REVIEW for merge] kbuild updates including silence of section
	mismatch check


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ