diff --git a/create_man_pages.py b/create_man_pages.py index ee7ca06b6..89077625c 100755 --- a/create_man_pages.py +++ b/create_man_pages.py @@ -4,6 +4,8 @@ import glob import os import sys import subprocess +from glob import glob +import shutil #TODO: Delete the old files to support removing a man page @@ -18,6 +20,18 @@ if not cmd_exists("pod2rst"): # the location relativate to xcat-core where the man pages will go MANPAGE_DEST="./docs/source/guides/admin-guides/references/man" +# +# add the following to delete the generate files before creating them +# essentially this allows us to remove man pages and they will be +# removed in the generation +print "Cleaning up the generated man pages in %s" %(MANPAGE_DEST) +allfiles = glob("%s*/*.rst" %(MANPAGE_DEST)) +for d in allfiles: + # Skip over the index.rst file + if not "index.rst" in d: + print "Removing file %s" %(d) + os.remove(d) + # List the xCAT component directory which contain pod pages COMPONENTS = ['xCAT-SoftLayer', 'xCAT-test', 'xCAT-client', 'xCAT-vlan'] @@ -35,14 +49,7 @@ for component in COMPONENTS: # title is needed to pass to pod2rst title = filename.split('.')[0] - # - # Wanted to have DESTINATION contain the man version, - # but we currently have man1,man3,man5,man8, etc in - # the .gitignore file. Need to fix Ubuntu builds - # - # DESTINATION = "%s%s" %(MANPAGE_DEST, man_ver) - # - DESTINATION = "%s" %(MANPAGE_DEST) + DESTINATION = "%s%s" %(MANPAGE_DEST, man_ver) try: os.stat(DESTINATION) except: diff --git a/docs/source/guides/admin-guides/references/index.rst b/docs/source/guides/admin-guides/references/index.rst index 88fe2b727..c258a56bd 100644 --- a/docs/source/guides/admin-guides/references/index.rst +++ b/docs/source/guides/admin-guides/references/index.rst @@ -13,7 +13,10 @@ xCAT Man Pages :maxdepth: 1 :glob: - man/* + man1/index.rst + man3/index.rst + man5/index.rst + man8/index.rst xCAT Database Tables diff --git a/docs/source/guides/admin-guides/references/man1/index.rst b/docs/source/guides/admin-guides/references/man1/index.rst new file mode 100644 index 000000000..ee289a2bd --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/index.rst @@ -0,0 +1,9 @@ +man1 +==== + + +.. toctree:: + :maxdepth: 1 + :glob: + + * diff --git a/docs/source/guides/admin-guides/references/man3/index.rst b/docs/source/guides/admin-guides/references/man3/index.rst new file mode 100644 index 000000000..c4050a6e0 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man3/index.rst @@ -0,0 +1,8 @@ +man3 +==== + +.. toctree:: + :maxdepth: 1 + :glob: + + * diff --git a/docs/source/guides/admin-guides/references/man5/index.rst b/docs/source/guides/admin-guides/references/man5/index.rst new file mode 100644 index 000000000..8364c574b --- /dev/null +++ b/docs/source/guides/admin-guides/references/man5/index.rst @@ -0,0 +1,8 @@ +man5 +==== + +.. toctree:: + :maxdepth: 1 + :glob: + + * diff --git a/docs/source/guides/admin-guides/references/man8/index.rst b/docs/source/guides/admin-guides/references/man8/index.rst new file mode 100644 index 000000000..87d64116a --- /dev/null +++ b/docs/source/guides/admin-guides/references/man8/index.rst @@ -0,0 +1,8 @@ +man8 +==== + +.. toctree:: + :maxdepth: 1 + :glob: + + *