From c55cc3463f5bad658a2b6b63355a13c1cb67f88d Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 5 Mar 2012 11:49:41 +0100
Subject: [PATCH] Split check-man-warnings into two
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This moves the dashes check to a new check-man-dashes script.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 Makefile.am                  |  3 +++
 autotools/check-man-dashes   | 24 ++++++++++++++++++++++++
 autotools/check-man-warnings |  3 ---
 3 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100755 autotools/check-man-dashes

diff --git a/Makefile.am b/Makefile.am
index 7f0b2f1c1..bd3be18f6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,6 +22,7 @@ BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
 RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
 CHECK_PYTHON_CODE = $(top_srcdir)/autotools/check-python-code
 CHECK_HEADER = $(top_srcdir)/autotools/check-header
+CHECK_MAN_DASHES = $(top_srcdir)/autotools/check-man-dashes
 CHECK_MAN_WARNINGS = $(top_srcdir)/autotools/check-man-warnings
 CHECK_VERSION = $(top_srcdir)/autotools/check-version
 CHECK_NEWS = $(top_srcdir)/autotools/check-news
@@ -590,6 +591,7 @@ EXTRA_DIST = \
 	autotools/check-header \
 	autotools/check-python-code \
 	autotools/check-imports \
+	autotools/check-man-dashes \
 	autotools/check-man-warnings \
 	autotools/check-news \
 	autotools/check-tar \
@@ -923,6 +925,7 @@ man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.man
 	$(PANDOC) -s -f rst -t man -A man/footer.man $< | \
 	  sed -e 's/\\@/@/g' > $@; \
 	if test -n "$(MAN_HAS_WARNINGS)"; then $(CHECK_MAN_WARNINGS) $@; fi; \
+	$(CHECK_MAN_DASHES) $@; \
 	trap - EXIT
 
 
diff --git a/autotools/check-man-dashes b/autotools/check-man-dashes
new file mode 100755
index 000000000..3ddd3ba86
--- /dev/null
+++ b/autotools/check-man-dashes
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+
+# Copyright (C) 2012 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+set -e
+
+! grep -F -q '\[em]' "$1" || \
+  { echo "Unescaped dashes found in $1, use \\-- instead of --" 1>&2; exit 1; }
diff --git a/autotools/check-man-warnings b/autotools/check-man-warnings
index 11205fd3a..8c8235e0a 100755
--- a/autotools/check-man-warnings
+++ b/autotools/check-man-warnings
@@ -24,6 +24,3 @@ set -e
   man --warnings --encoding=utf8 --local-file "$1" 2>&1 >/dev/null | \
   grep -v -e "cannot adjust line" -e "can't break line" | \
   grep .
-
-! grep -F -q '\[em]' "$1" || \
-  { echo "Unescaped dashes found in $1, use \\-- instead of --" 1>&2; exit 1; }
-- 
GitLab