1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1F22A431FB6
\r
6 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 12:05:48 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id zG8OQGF4RQ3n for <notmuch@notmuchmail.org>;
\r
16 Sat, 5 Apr 2014 12:05:40 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id AEC71431FAF
\r
19 for <notmuch@notmuchmail.org>; Sat, 5 Apr 2014 12:05:39 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id D5364100051;
\r
22 Sat, 5 Apr 2014 22:05:31 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: "W. Trevor King" <wking@tremily.us>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH 5/7] doc: Allow rst2man.py as an alternative to rst2man
\r
27 <adce76bb9a0ca728d856da4ecaf6b282e22e7440.1396718720.git.wking@tremily.us>
\r
28 References: <cover.1396718720.git.wking@tremily.us>
\r
29 <adce76bb9a0ca728d856da4ecaf6b282e22e7440.1396718720.git.wking@tremily.us>
\r
30 User-Agent: Notmuch/0.17+174~gef82849 (http://notmuchmail.org) Emacs/24.3.1
\r
31 (x86_64-unknown-linux-gnu)
\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
33 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
34 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
35 Date: Sat, 05 Apr 2014 22:05:31 +0300
\r
36 Message-ID: <m2a9bzd2bo.fsf@guru.guru-group.fi>
\r
38 Content-Type: text/plain
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Sat, 05 Apr 2014 19:05:48 -0000
\r
53 On Sat, Apr 05 2014, "W. Trevor King" <wking@tremily.us> wrote:
\r
55 > Gentoo's dev-python/docutils-0.10 installs Docutils scripts with a
\r
56 > *.py extension, so I have /usr/bin/rst2man.py and no rst2man script.
\r
57 > This patch supports users with both types of systems by checking for
\r
58 > rst2man, falling back on rst2man.py, and giving up only if neither is
\r
59 > found. Users can also set the new RST2MAN path variable explicitly
\r
60 > when they call Make:
\r
62 > make RST2MAN=/my/custom/rst_to_man_converter build-man
\r
64 > I use POSIX's 'command -v' [1] to find the path to rst2man or
\r
65 > rst2man.py, and save that as RST2MAN in Makefile.config. We can use a
\r
66 > non-empty RST2MAN to check for the availability of an rst2man program,
\r
67 > so there's no need for a separate HAVE_RST2MAN. Then pass the
\r
68 > configured RST2MAN path through to prerst2man.py to use in its system
\r
71 > [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
\r
73 This series looks good to me.
\r
75 Except the reference to _POSIX_ page. One knows how consistent these
\r
76 specifications are; alternative:
\r
78 http://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html
\r
80 mentions additionally that -v flag
\r
81 "(On systems supporting the User Portability Utilities option.)"
\r
83 Also, we don't give such a treatment to other command either; I'd rather
\r
84 see RST2MAN=rst2man, RST2MAN=rst2man.py *and* RST2MAN= lines used
\r
85 instead -- the last to set RST2MAN to empty string instead of being unset.
\r
91 > configure | 12 +++++++-----
\r
92 > doc/Makefile.local | 6 +++---
\r
93 > doc/prerst2man.py | 9 +++++----
\r
94 > 3 files changed, 15 insertions(+), 12 deletions(-)
\r
96 > diff --git a/configure b/configure
\r
97 > index 1d430b9..81c286b 100755
\r
100 > @@ -400,7 +400,6 @@ printf "Checking if sphinx is available and supports nroff output... "
\r
101 > if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then
\r
106 > printf "No (falling back to rst2man).\n"
\r
108 > @@ -408,10 +407,12 @@ else
\r
109 > printf "Checking if rst2man is available... "
\r
110 > if rst2man -V > /dev/null 2>&1; then
\r
113 > + RST2MAN=$(command -v rst2man)
\r
114 > + elif rst2man.py -V > /dev/null 2>&1; then
\r
115 > + printf "Yes.\n"
\r
116 > + RST2MAN=$(command -v rst2man.py)
\r
118 > printf "No (so will not install man pages).\n"
\r
123 > @@ -788,8 +789,9 @@ HAVE_EMACS = ${have_emacs}
\r
124 > # Whether there's a sphinx-build binary available for building documentation
\r
125 > HAVE_SPHINX=${have_sphinx}
\r
127 > -# Whether there's a rst2man binary available for building documentation
\r
128 > -HAVE_RST2MAN=${have_rst2man}
\r
129 > +# The path to the rst2man program for building documentation. Set to
\r
130 > +# an empty string if no such program is available.
\r
131 > +RST2MAN=${RST2MAN}
\r
133 > # The directory to which desktop files should be installed
\r
134 > desktop_dir = \$(prefix)/share/applications
\r
135 > diff --git a/doc/Makefile.local b/doc/Makefile.local
\r
136 > index 0980c71..e08fc99 100644
\r
137 > --- a/doc/Makefile.local
\r
138 > +++ b/doc/Makefile.local
\r
139 > @@ -42,8 +42,8 @@ ifeq ($(HAVE_SPHINX),1)
\r
140 > mkdir -p $(DOCBUILDDIR)/man/man$${section}; \
\r
141 > mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \
\r
143 > -else ifeq ($(HAVE_RST2MAN),1)
\r
144 > - $(prerst2man) $(srcdir)/doc $(DOCBUILDDIR)/man
\r
145 > +else ifdef RST2MAN
\r
146 > + $(prerst2man) "$(RST2MAN)" $(srcdir)/doc $(DOCBUILDDIR)/man
\r
148 > @echo "Fatal: build dependency fail."
\r
150 > @@ -51,7 +51,7 @@ endif
\r
152 > # Do not try to build or install man pages if a man page converter is
\r
154 > -ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
\r
155 > +ifeq ($(HAVE_SPHINX)$(RST2MAN),0)
\r
158 > @echo "No sphinx or rst2man, will not install man pages."
\r
159 > diff --git a/doc/prerst2man.py b/doc/prerst2man.py
\r
160 > index 437dea9..81ce817 100644
\r
161 > --- a/doc/prerst2man.py
\r
162 > +++ b/doc/prerst2man.py
\r
163 > @@ -4,8 +4,9 @@ from os.path import dirname, isdir
\r
164 > from os import makedirs, system
\r
167 > -sourcedir = argv[1]
\r
168 > -outdir = argv[2]
\r
169 > +rst2man = argv[1]
\r
170 > +sourcedir = argv[2]
\r
171 > +outdir = argv[3]
\r
173 > if not isdir(outdir):
\r
174 > makedirs(outdir, 0o755)
\r
175 > @@ -59,5 +60,5 @@ for page in man_pages:
\r
176 > outfile.write("".join(lines))
\r
179 > - system('set -x; rst2man {0} {1}/{2}.{3}'
\r
180 > - .format(filename, outdir, page[0], page[4]))
\r
181 > + system('set -x; {0} {1} {2}/{3}.{4}'
\r
182 > + .format(rst2man, filename, outdir, page[0], page[4]))
\r
184 > 1.9.1.353.gc66d89d
\r
186 > _______________________________________________
\r
187 > notmuch mailing list
\r
188 > notmuch@notmuchmail.org
\r
189 > http://notmuchmail.org/mailman/listinfo/notmuch
\r