unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [Patch v2 1/3] doc: have prerst2man.py generate roff files all in one directory
Date: Tue, 11 Mar 2014 09:05:53 -0300	[thread overview]
Message-ID: <1394539555-28334-2-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1394539555-28334-1-git-send-email-david@tethera.net>

Originally it seemed tidier to put them in subdirectories, but it
turned out not to be obvious how to do that with sphinx. Bring the two
methods back in sync again, and unbreak the generation of gzipped
manpages.

As a side-effect, fix a particular egregious combination of format and
string concatenation.
---
 doc/prerst2man.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/doc/prerst2man.py b/doc/prerst2man.py
index 720deb6..ec343e7 100644
--- a/doc/prerst2man.py
+++ b/doc/prerst2man.py
@@ -32,10 +32,7 @@ date.today().isoformat(), release, section, project))
 
 blankre = re.compile("^\s*$")
 for page in man_pages:
-    outdirname = outdir + '/' + dirname(page[0])
-    if not isdir(outdirname):
-        makedirs(outdirname, 0755)
-    filename = outdir + '/' + page[0] + '.rst'
+    filename = outdir + '/' + page[1] + '.rst'
     outfile = open(filename, 'w')
     infile = open(sourcedir + '/' + page[0] + '.rst', 'r')
 
@@ -59,4 +56,5 @@ for page in man_pages:
     outfile.write("".join(lines))
     outfile.close()
 
-    os.system('set -x; rst2man {0} {1}'.format(filename, outdir + '/' + page[0] + '.' + str(page[4])))
+    os.system('set -x; rst2man {0} {1}/{2}.{3}'
+              .format(filename, outdir, page[1],page[4]))
-- 
1.8.5.3

  reply	other threads:[~2014-03-11 12:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 12:05 v2 man page build fixups David Bremner
2014-03-11 12:05 ` David Bremner [this message]
2014-03-11 12:05 ` [Patch v2 2/3] doc: build man pages at build time; introduce HAVE_SPHINX, HAVE_RST2MAN David Bremner
2014-03-11 12:05 ` [Patch v2 3/3] doc: configure detection of sphinx and rst2man David Bremner
2014-03-11 18:16 ` v2 man page build fixups Tomi Ollila
2014-03-13  3:21   ` David Bremner
2014-03-13  3:21     ` [Patch v3 1/4] doc: build man pages at build time; introduce HAVE_SPHINX, HAVE_RST2MAN David Bremner
2014-03-13  3:21     ` [Patch v3 2/4] doc: build man pages into hierarchy, fix help test David Bremner
2014-03-13  3:21     ` [Patch v3 3/4] doc: configure detection of sphinx and rst2man David Bremner
2014-03-13  3:21     ` [Patch v3 4/4] doc: cosmetic fix for prerst2man.py David Bremner
2014-03-17 10:55     ` Tomi Ollila
2014-03-18 10:52     ` Re: David Bremner

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=1394539555-28334-2-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).