maint: avoid spurious output if program not present

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.
But a subshell is only needed in places where it is reasonable
to expect the use of such a noisy shell in the first place.

* src/Makefile.am (remote_protocol-structs): Use subshell, for
FreeBSD 8.0 /bin/sh.
* cfg.mk (sc_preprocessor_indentation): Avoid subshell, since the
only users running cfg.mk can be assumed to have decent tools.
This commit is contained in:
Eric Blake 2010-05-10 14:17:10 -06:00
parent 23958aedf4
commit 7cdf26637e
2 changed files with 2 additions and 2 deletions

2
cfg.mk
View File

@ -252,7 +252,7 @@ sc_prohibit_trailing_blank_lines:
preprocessor_exempt = (remote_(driver|protocol)\.h)$$ preprocessor_exempt = (remote_(driver|protocol)\.h)$$
# Enforce recommended preprocessor indentation style. # Enforce recommended preprocessor indentation style.
sc_preprocessor_indentation: sc_preprocessor_indentation:
@if (cppi --version >/dev/null 2>&1); then \ @if cppi --version >/dev/null 2>&1; then \
$(VC_LIST_EXCEPT) | grep '\.[ch]$$' \ $(VC_LIST_EXCEPT) | grep '\.[ch]$$' \
| grep -vE '$(preprocessor_exempt)' | xargs cppi -a -c \ | grep -vE '$(preprocessor_exempt)' | xargs cppi -a -c \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \ || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \

View File

@ -169,7 +169,7 @@ EXTRA_DIST += remote/remote_protocol.x remote/rpcgen_fix.pl
# * remove white space at end of buffer # * remove white space at end of buffer
.PHONY: remote_protocol-structs .PHONY: remote_protocol-structs
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) \ pdwtags libvirt_driver_remote_la-remote_protocol.$(OBJEXT) \
| perl -0777 -n \ | perl -0777 -n \
-e 'foreach my $$p (split m!\n\n/\* \d+ \*/\n!)' \ -e 'foreach my $$p (split m!\n\n/\* \d+ \*/\n!)' \