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 via email to