Man page: Make target "netboot" go before "netboot2"
authorSebastian Pipping <sebastian@pipping.org>
Mon, 9 Jul 2012 15:47:38 +0000 (17:47 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Mon, 9 Jul 2012 15:47:38 +0000 (17:47 +0200)
doc/make_target_table.py

index b72935fa10ef371133a7a3b1a069f22d301f5271..378ae53c1469064af210e66e3561986bff065830 100755 (executable)
@@ -15,8 +15,13 @@ import glob
 import re
 
 
+def key_netboot_before_netboot2((target_name, module)):
+       return target_name + '1'
+
+
 if __name__ == '__main__':
        extractor = re.compile('^modules/(([^ ]+)_target).py$')
+       targets = list()
        for filename in sorted(glob.glob('modules/*_target.py')):
                if 'generic' in filename:
                        continue
@@ -28,6 +33,9 @@ if __name__ == '__main__':
                __import__(module_name)
                module = _sys.modules[module_name]
 
+               targets.append((target_name, module))
+
+       for target_name, module in sorted(targets, key=key_netboot_before_netboot2):
                print('`%s`;;' % target_name)
                # Replace blank lines with `+` (asciidoc list item continuation)
                print(module.__doc__.strip().replace('\n\n', '\n+\n'))