-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: rewrite shell scripts in Python
Shell used in documentation generation could not run on Windows. Rewrite scripts in Python. New scripts use proper path separators and handle paths with spaces. Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
- Loading branch information
1 parent
a9d84ea
commit 53bb9a0
Showing
5 changed files
with
53 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# (c) 2018 Luca Boccassi <bluca@debian.org> | ||
# (c) 2022 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> | ||
|
||
import os, re, subprocess, sys | ||
|
||
pattern = re.compile('^Preprocessing (.*)...$') | ||
out_dir, *doxygen_command = sys.argv[1:] | ||
out_file = os.path.join(os.path.dirname(out_dir), 'doxygen.out') | ||
dep_file = f'{out_dir}.d' | ||
with open(out_file, 'w') as out: | ||
subprocess.run(doxygen_command, check=True, stdout=out) | ||
with open(out_file) as out, open(dep_file, 'w') as dep: | ||
print(f'{out_dir}:', end=' ', file=dep) | ||
for line in out: | ||
match = re.match(pattern, line) | ||
if match: | ||
print(match.group(1), end=' ', file=dep) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# (c) 2018 Luca Boccassi <bluca@debian.org> | ||
# (c) 2022 Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> | ||
|
||
import os, sys | ||
|
||
examples_dir, api_examples = sys.argv[1:] | ||
|
||
sources = [] | ||
with open(f'{api_examples}.d', 'w') as dep: | ||
print(f'{api_examples}:', end=' ', file=dep) | ||
for root, _, files in os.walk(examples_dir): | ||
for name in files: | ||
is_source = name.endswith('.c') | ||
if is_source or name == 'meson.build': | ||
path = os.path.join(root, name) | ||
if is_source: | ||
sources.append(path) | ||
print(path , end=' ', file=dep) | ||
|
||
with open(api_examples, 'w') as out: | ||
print('''/** | ||
@page examples DPDK Example Programs | ||
''', file=out) | ||
for path in sources: | ||
# Produce consistent output with forward slashes on all systems. | ||
# Every \ in paths within examples directory is a separator, not escape. | ||
relpath = os.path.relpath(path, examples_dir).replace('\\', '/') | ||
print(f'@example examples/{relpath}', file=out) | ||
print('*/', file=out) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters