Files
linux-kernel-module-cheat/build-doc
Ciro Santilli 六四事件 法轮功 21d9be41e5 build: make --dry-run work again on all
2019-05-14 21:41:12 +01:00

40 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python3
import re
import common
from shell_helpers import LF
class Main(common.LkmcCliFunction):
def __init__(self):
super().__init__(
defaults = {
'show_time': False,
},
description='''\
https://github.com/cirosantilli/linux-kernel-module-cheat#build-the-documentation
''',
)
def timed_main(self):
self.sh.run_cmd(
[
'asciidoctor', LF,
'-o', self.env['readme_out'], LF,
'-v', self.env['readme'], LF,
],
out_file=self.env['build_doc_log'],
)
error_re = re.compile('^asciidoctor: WARNING: ')
exit_status = 0
if not self.env['dry_run']:
with open(self.env['build_doc_log']) as f:
for line in f:
if error_re.search(line):
exit_status = 1
break
return exit_status
if __name__ == '__main__':
Main().cli()