diff options
author | Jack Lloyd <[email protected]> | 2018-01-21 12:49:15 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-01-21 12:49:15 -0500 |
commit | 65f375348c0773af6e9bbe3a005aef177dfd4ac3 (patch) | |
tree | 138fb3bb7995a282f4ebfd8033a0f53ceb4872fe /configure.py | |
parent | 66d6ee2761e5152f9777b90dccdb569ce5156001 (diff) |
Fix headers of command line docs
Sphinx and rst2man want slightly different things, so just edit the
Sphinx-formatted ReST into a file in build dir
Fixes #1398
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/configure.py b/configure.py index d1b6a9307..9d7cf364b 100755 --- a/configure.py +++ b/configure.py @@ -2830,10 +2830,8 @@ def calculate_cc_min_version(options, ccinfo, source_paths): logging.info('Auto-detected compiler version %s' % (cc_version)) return cc_version -def do_io_for_build(cc, arch, osinfo, - using_mods, build_paths, template_vars, - source_paths, options): - # pylint: disable=too-many-locals +def do_io_for_build(cc, arch, osinfo, using_mods, build_paths, source_paths, template_vars, options): + # pylint: disable=too-many-locals,too-many-branches try: robust_rmtree(build_paths.build_dir) @@ -2909,6 +2907,30 @@ def do_io_for_build(cc, arch, osinfo, makefile_template = os.path.join(source_paths.build_data_dir, 'makefile.in') write_template(template_vars['makefile_path'], makefile_template) + if options.with_rst2man: + rst2man_file = os.path.join(build_paths.build_dir, 'botan.rst') + cli_doc = os.path.join(source_paths.doc_dir, 'manual/cli.rst') + + cli_doc_contents = open(cli_doc).readlines() + + while cli_doc_contents[0] != "\n": + cli_doc_contents.pop(0) + + rst2man_header = """ +botan +============================= + +:Subtitle: Botan command line util +:Manual section: 1 + + """.strip() + + with open(rst2man_file, 'w') as f: + f.write(rst2man_header) + f.write("\n") + for line in cli_doc_contents: + f.write(line) + logging.info('Botan %s (revision %s) (%s %s) build setup is complete' % ( Version.as_string(), Version.vc_rev(), @@ -2996,7 +3018,7 @@ def main(argv): template_vars = create_template_vars(source_paths, build_paths, options, using_mods, cc, arch, osinfo) # Now we start writing to disk - do_io_for_build(cc, arch, osinfo, using_mods, build_paths, template_vars, source_paths, options) + do_io_for_build(cc, arch, osinfo, using_mods, build_paths, source_paths, template_vars, options) return 0 |