linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Miller <alex.miller-Mmb7MZpHnFY@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 1/4] Makefile: Don't leave $(GROFF_LOG) files behind
Date: Thu, 14 Apr 2016 01:13:04 +0200	[thread overview]
Message-ID: <20160414011304.289a6494.alex.miller@gmx.de> (raw)
In-Reply-To: <20160414010434.1a7bdcfc.alex.miller-Mmb7MZpHnFY@public.gmane.org>

Convert "GROFF_LOG" into a shell variable local to the
recipe for "check-groff-warnings" target such that the
temporary file is only created when needed.

Signed-off-by: Alexander Miller <alex.miller-Mmb7MZpHnFY@public.gmane.org>
---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 237310d..1003843 100644
--- a/Makefile
+++ b/Makefile
@@ -63,14 +63,14 @@ install:
 
 # Check if groff reports warnings (may be words of sentences not displayed)
 # from http://lintian.debian.org/tags/manpage-has-errors-from-man.html 
-GROFF_LOG := $(shell mktemp /tmp/manpages-checksXXXX)
 check-groff-warnings:
+	GROFF_LOG=$$(mktemp /tmp/manpages-checksXXXX); \
 	for i in man?/*.[1-9]; \
 	do \
 		if grep -q 'SH.*NAME' $$i; then \
-			LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$(GROFF_LOG); \
-			[ -s $(GROFF_LOG) ] && ( echo "$$i: " ; cat $(GROFF_LOG) ; echo "" ); \
-			rm $(GROFF_LOG) 2>/dev/null; \
+			LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$$GROFF_LOG; \
+			[ -s $$GROFF_LOG ] && ( echo "$$i: " ; cat $$GROFF_LOG ; echo "" ); \
+			rm $$GROFF_LOG 2>/dev/null; \
 		fi \
 	done
 
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-04-13 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 23:04 [PATCH 0/4] Makefile: fix temporary file handling and improve check-groff-warnings Alexander Miller
     [not found] ` <20160414010434.1a7bdcfc.alex.miller-Mmb7MZpHnFY@public.gmane.org>
2016-04-13 23:13   ` Alexander Miller [this message]
     [not found]     ` <20160414011304.289a6494.alex.miller-Mmb7MZpHnFY@public.gmane.org>
2016-04-13 23:28       ` [PATCH 1/4] Makefile: Don't leave $(GROFF_LOG) files behind Mike Frysinger
2016-04-13 23:16   ` [PATCH 2/4] Makefile: Improve recipe for "check-groff-warnings" target Alexander Miller
2016-04-13 23:17   ` [PATCH 3/4] Makefile: wsfix (trailing space) Alexander Miller
2016-04-13 23:18   ` [PATCH 4/4] Makefile: Remove line continuation at end of "install" recipe Alexander Miller
2016-04-18 12:51   ` [PATCH 0/4] Makefile: fix temporary file handling and improve check-groff-warnings Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160414011304.289a6494.alex.miller@gmx.de \
    --to=alex.miller-mmb7mzphnfy@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).