Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751664AbbGLV7q (ORCPT ); Sun, 12 Jul 2015 17:59:46 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:34815 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751533AbbGLV7o (ORCPT ); Sun, 12 Jul 2015 17:59:44 -0400 From: Ulf Magnusson X-Google-Original-From: Ulf Magnusson To: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: mmarek@suse.cz, corbet@lwn.net, herbert@gondor.apana.org.au, smueller@chronox.de, Ulf Magnusson Subject: [PATCH] DocBook: Avoid stdout junk with no man pages to compress Date: Sun, 12 Jul 2015 23:59:18 +0200 Message-Id: <1436738358-19546-1-git-send-email-ulfalizer@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1755 Lines: 55 gzip would run as 'gzip -f' when no uncompressed man pages were found, making it compress the (empty) stdin to stdout. A few alternative solutions: - 'find' with {} + might be speedier, but maybe that's not portable enough (though it's in POSIX 2001 at least AFAICS) - xargs --no-run-if-empty, but that's a GNU extension - Always discarding stdout, if it's unlikely to ever be helpful - More fancy stuff like the following, though maybe some of them could run into shell limits too, re. d56fcf299fb4 (DocBook: Do not exceed argument list limit) * A plain shell 'for' loop * mandocs: $(MAN) if [ `find $(obj)/man -name '*.9' | wc -l` -gt 0 ]; then \ find $(obj)/man -name '*.9' | xargs gzip -f; \ fi * mandocs: $(MAN) man_pages=`find $(obj)/man -name '*.9'`; \ if [ -n "$$man_pages" ]; then \ echo "$$man_pages" | xargs gzip -f; \ fi Signed-off-by: Ulf Magnusson --- Documentation/DocBook/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index b6a6a2e..73bddf7 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -56,7 +56,7 @@ htmldocs: $(HTML) MAN := $(patsubst %.xml, %.9, $(BOOKS)) mandocs: $(MAN) - find $(obj)/man -name '*.9' | xargs gzip -f + find $(obj)/man -name '*.9' -exec gzip -f {} \; installmandocs: mandocs mkdir -p /usr/local/man/man9/ -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/