]> git.baikalelectronics.ru Git - kernel.git/commit
setlocalversion: Use "grep -q" instead of piping output to "read dummy"
authorRoland Dreier <roland@purestorage.com>
Fri, 23 Mar 2012 16:42:27 +0000 (09:42 -0700)
committerMichal Marek <mmarek@suse.cz>
Mon, 26 Mar 2012 20:54:00 +0000 (22:54 +0200)
commit421a0d77efbd0b215bb0a745278af1d07d6a5d84
tree2fdc4e64fce2f6697683b4b05c20877036d62572
parent31c44ae206c9fcb760908ee4485c29d1aef2214d
setlocalversion: Use "grep -q" instead of piping output to "read dummy"

In some circumstances (eg when running a build in an emacs shell
buffer), I get a spew of messages like

    grep: writing output: Broken pipe

from setlocalversion, because the "read" subshell apparently exits as
soon as it reads one line and gives EPIPE to grep.  It's not clear to
me why this way of writing the check was used instead of just using
grep -q to suppress output, but unless there is some deep reason I
don't know, this way looks cleaner to me anyway, and gets rid of the
ugly message spew.

(I double checked at http://pubs.opengroup.org/onlinepubs/009604499/utilities/grep.html
and "grep -q" is specified in POSIX / SuS, so hopefully even people
cross-compiling the kernel on some bizarre host OS can't complain
about this change)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/setlocalversion