From 67c15d8b42a19b33c86aa3b05703c902eb5c824d Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 6 Mar 2013 10:43:51 +0100
Subject: [PATCH] Fix bug in man build rule
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently the man page build rule is run without β€˜-e’, so the actual
checks in there are just warnings (check-man-warnings,
check-man-dashes).

The patch fixes this and also fixes the man pages which made me see the
problem.

Additionally, check-man-dashes is now verbose, otherwise it's hard to
find out actually where in the page the error is.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
---
 Makefile.am                |  2 +-
 autotools/check-man-dashes |  4 ++--
 man/gnt-job.rst            |  2 +-
 man/gnt-network.rst        | 32 ++++++++++++++++----------------
 man/gnt-node.rst           |  2 +-
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4c26ba6f5..cf6e33430 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1293,7 +1293,7 @@ man/%.gen: man/%.rst lib/query.py lib/build/sphinx_ext.py \
 man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
 	@test -n "$(PANDOC)" || \
 	  { echo 'pandoc' not found during configure; exit 1; }
-	set -o pipefail ; \
+	set -o pipefail -e; \
 	trap 'echo auto-removing $@; rm $@' EXIT; \
 	$(PANDOC) -s -f rst -t man $< man/footer.rst | \
 	  sed -e 's/\\@/@/g' > $@; \
diff --git a/autotools/check-man-dashes b/autotools/check-man-dashes
index 3ddd3ba86..9ad87249c 100755
--- a/autotools/check-man-dashes
+++ b/autotools/check-man-dashes
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 
-# Copyright (C) 2012 Google Inc.
+# Copyright (C) 2012, 2013 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
@@ -20,5 +20,5 @@
 
 set -e
 
-! grep -F -q '\[em]' "$1" || \
+! grep -F '\[em]' "$1" || \
   { echo "Unescaped dashes found in $1, use \\-- instead of --" 1>&2; exit 1; }
diff --git a/man/gnt-job.rst b/man/gnt-job.rst
index 20e5aa51e..83a336136 100644
--- a/man/gnt-job.rst
+++ b/man/gnt-job.rst
@@ -53,7 +53,7 @@ respective state, ``--pending`` includes both.
 CHANGE-PRIORITY
 ~~~~~~~~~~~~~~~
 
-| **change-priority** --priority {low | normal | high}
+| **change-priority** \--priority {low | normal | high}
 | {[\--force] {\--pending | \--queued | \--waiting} | *job-id* ...}
 
 Changes the priority of one or multiple pending jobs. Jobs currently
diff --git a/man/gnt-network.rst b/man/gnt-network.rst
index 69848cde3..59e8e02b9 100644
--- a/man/gnt-network.rst
+++ b/man/gnt-network.rst
@@ -26,13 +26,13 @@ ADD
 ~~~
 
 | **add**
-| [--network=*NETWORK*]
-| [--gateway=*GATEWAY*]
-| [--add-reserved-ips=*RESERVEDIPS*]
-| [--network6=*NETWORK6*]
-| [--gateway6=*GATEWAY6*]
-| [--mac-prefix=*MACPREFIX*]
-| [--submit]
+| [\--network=*NETWORK*]
+| [\--gateway=*GATEWAY*]
+| [\--add-reserved-ips=*RESERVEDIPS*]
+| [\--network6=*NETWORK6*]
+| [\--gateway6=*GATEWAY6*]
+| [\--mac-prefix=*MACPREFIX*]
+| [\--submit]
 | {*network*}
 
 Creates a new network with the given name. The network will be unused
@@ -62,13 +62,13 @@ MODIFY
 ~~~~~~
 
 | **modify**
-| [--gateway=*GATEWAY*]
-| [--add-reserved-ips=*RESERVEDIPS*]
-| [--remove-reserved-ips=*RESERVEDIPS*]
-| [--network6=*NETWORK6*]
-| [--gateway6=*GATEWAY6*]
-| [--mac-prefix=*MACPREFIX*]
-| [--submit]
+| [\--gateway=*GATEWAY*]
+| [\--add-reserved-ips=*RESERVEDIPS*]
+| [\--remove-reserved-ips=*RESERVEDIPS*]
+| [\--network6=*NETWORK6*]
+| [\--gateway6=*GATEWAY6*]
+| [\--mac-prefix=*MACPREFIX*]
+| [\--submit]
 | {*network*}
 
 Modifies parameters from the network.
@@ -83,7 +83,7 @@ options.
 REMOVE
 ~~~~~~
 
-| **remove** [--submit] {*network*}
+| **remove** [\--submit] {*network*}
 
 Deletes the indicated network, which must be not connected to any node group.
 
@@ -92,7 +92,7 @@ See **ganeti**\(7) for a description of ``--submit`` and other common options.
 LIST
 ~~~~
 
-| **list** [--no-headers] [--separator=*SEPARATOR*] [-v]
+| **list** [\--no-headers] [\--separator=*SEPARATOR*] [-v]
 | [-o *[+]FIELD,...*] [network...]
 
 Lists all existing networks in the cluster. If no group names are given,
diff --git a/man/gnt-node.rst b/man/gnt-node.rst
index 78edd5d03..af95a27bf 100644
--- a/man/gnt-node.rst
+++ b/man/gnt-node.rst
@@ -585,7 +585,7 @@ annotated in the command line output.
 RESTRICTED-COMMAND
 ~~~~~~~~~~~~~~~~~~
 
-| **restricted-command** [-M] [--sync]
+| **restricted-command** [-M] [\--sync]
 | { -g *group* *command* | *command* *nodes*... }
 
 Executes a restricted command on the specified nodes. Restricted commands are
-- 
GitLab