diff options
| author | snermolaev <[email protected]> | 2025-11-20 09:56:26 +0300 |
|---|---|---|
| committer | snermolaev <[email protected]> | 2025-11-20 10:20:46 +0300 |
| commit | a28ab4eda757fd0095a375620f3799dc4189b773 (patch) | |
| tree | 7edc58ff318d2cff7e12c5ae8de0985b3b9d5b79 /build/scripts | |
| parent | bc4fe3c5578943241722ace5d84caa0ea86036fa (diff) | |
DOCSBOOK is final target again; additional output preprocessed.tar.gz for DOCSBOOK
commit_hash:5a3ad292b315b6435b4929ce2a5dfe5f9ffed7cf
Diffstat (limited to 'build/scripts')
| -rw-r--r-- | build/scripts/extract_docs.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/build/scripts/extract_docs.py b/build/scripts/extract_docs.py index 005ba8950e1..09d6a45a87a 100644 --- a/build/scripts/extract_docs.py +++ b/build/scripts/extract_docs.py @@ -12,7 +12,6 @@ import process_command_files as pcf # noqa: E402 def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--dest-dir', required=True) - parser.add_argument('--skip-prefix', dest='skip_prefixes', action='append', default=[]) parser.add_argument('docs', nargs='*') return parser.parse_args(pcf.get_args(sys.argv[1:])) @@ -20,23 +19,12 @@ def parse_args(): def main(): args = parse_args() - prefixes = ['{}{}'.format(os.path.normpath(p), os.path.sep) for p in args.skip_prefixes] - def _valid_docslib(path): base = os.path.basename(path) - return base.endswith(('.docslib', '.docslib.fake')) or base == 'preprocessed.tar.gz' + return base.endswith(('.docslib', '.docslib.fake')) or base == '_preprocessed.tar.gz' + dest_dir = args.dest_dir for src in [p for p in args.docs if _valid_docslib(p)]: - if src == 'preprocessed.tar.gz': - rel_dst = os.path.dirname(os.path.normpath(src)) - for prefix in prefixes: - if src.startswith(prefix): - rel_dst = rel_dst[len(prefix) :] - continue - assert not os.path.isabs(rel_dst) - dest_dir = os.path.join(args.dest_dir, rel_dst) - else: - dest_dir = args.dest_dir if not os.path.exists(dest_dir): os.makedirs(dest_dir) with tarfile.open(src, 'r') as tar_file: |
