[libvirt] [PATCH] maint: avoid spurious output if program not present

Eric Blake eblake at redhat.com
Mon May 10 20:19:41 UTC 2010


Some shells warn about missing programs before redirection;
the idiomatic way to silence them is to run the program check
inside a subshell, with the redirections outside the subshell.

* cfg.mk (sc_preprocessor_indentation): Use correct subshell.
* src/Makefile.am (remote_protocol-structs): Use subshell.
---
 cfg.mk          |    2 +-
 src/Makefile.am |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index d1f8485..fbc0433 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -252,7 +252,7 @@ sc_prohibit_trailing_blank_lines:
 preprocessor_exempt = (remote_(driver|protocol)\.h)$$
 # Enforce recommended preprocessor indentation style.
 sc_preprocessor_indentation:
-	@if (cppi --version >/dev/null 2>&1); then			\
+	@if (cppi --version) >/dev/null 2>&1; then			\
 	  $(VC_LIST_EXCEPT) | grep '\.[ch]$$'				\
 	    | grep -vE '$(preprocessor_exempt)' | xargs cppi -a -c	\
 	    || { echo '$(ME): incorrect preprocessor indentation' 1>&2;	\
diff --git a/src/Makefile.am b/src/Makefile.am
index fe33cea..1542ab1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -169,7 +169,7 @@ EXTRA_DIST += remote/remote_protocol.x remote/rpcgen_fix.pl
 # * remove white space at end of buffer
 .PHONY: remote_protocol-structs
 remote_protocol-structs:
-	$(AM_V_GEN)if pdwtags --help > /dev/null 2>&1; then		\
+	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
 	  pdwtags libvirt_driver_remote_la-remote_protocol.$(OBJEXT)	\
 	    | perl -0777 -n						\
 		-e 'foreach my $$p (split m!\n\n/\* \d+ \*/\n!)'	\
-- 
1.7.0.1




More information about the libvir-list mailing list