mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
build-doc: exit 1 on error, add to release testing
This commit is contained in:
5
build
5
build
@@ -164,6 +164,7 @@ so looping over all of them would waste time.
|
||||
'qemu-gem5-buildroot',
|
||||
'all-baremetal',
|
||||
'user-mode-qemu',
|
||||
'doc',
|
||||
]),
|
||||
'all-baremetal': _Component(dependencies=[
|
||||
'qemu-baremetal',
|
||||
@@ -220,6 +221,9 @@ so looping over all of them would waste time.
|
||||
},
|
||||
submodules={'crosstool-ng'},
|
||||
),
|
||||
'doc': _Component(
|
||||
self._build_file('build-doc'),
|
||||
),
|
||||
'gem5': _Component(
|
||||
self._build_file('build-gem5'),
|
||||
**gem5_deps
|
||||
@@ -301,6 +305,7 @@ so looping over all of them would waste time.
|
||||
),
|
||||
'release': _Component(dependencies=[
|
||||
'qemu-buildroot',
|
||||
'doc',
|
||||
]),
|
||||
'test-gdb': _Component(dependencies=[
|
||||
'all-baremetal',
|
||||
|
||||
40
build-doc
40
build-doc
@@ -1,2 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
asciidoctor -o out/README.html -v README.adoc
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
|
||||
import common
|
||||
from shell_helpers import LF
|
||||
|
||||
class Main(common.LkmcCliFunction):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
defaults = {
|
||||
'print_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
|
||||
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()
|
||||
|
||||
@@ -42,6 +42,9 @@ if consts['in_docker']:
|
||||
consts['out_dir'] = os.path.join(consts['root_dir'], 'out.docker')
|
||||
else:
|
||||
consts['out_dir'] = os.path.join(consts['root_dir'], 'out')
|
||||
consts['readme'] = os.path.join(consts['root_dir'], 'README.adoc')
|
||||
consts['readme_out'] = os.path.join(consts['out_dir'], 'README.html')
|
||||
consts['build_doc_log'] = os.path.join(consts['out_dir'], 'build-doc.log')
|
||||
consts['gem5_out_dir'] = os.path.join(consts['out_dir'], 'gem5')
|
||||
consts['kernel_modules_build_base_dir'] = os.path.join(consts['out_dir'], 'kernel_modules')
|
||||
consts['buildroot_out_dir'] = os.path.join(consts['out_dir'], 'buildroot')
|
||||
|
||||
Reference in New Issue
Block a user