aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/extract_docs.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-24 10:56:19 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-24 10:56:19 +0300
commit8eb84376d8c1f5faaf0ac0e7eba3e2b3bcbd0ae8 (patch)
tree04cfcba1ffb5d334476f1ad50d7dd1d76e7a8aa1 /build/scripts/extract_docs.py
parent4d0f898009f810ee61c0fa44367b643c849544d6 (diff)
downloadydb-8eb84376d8c1f5faaf0ac0e7eba3e2b3bcbd0ae8.tar.gz
intermediate changes
ref:527bb3174f1e8e3768bf958e7e534e7c93982609
Diffstat (limited to 'build/scripts/extract_docs.py')
-rw-r--r--build/scripts/extract_docs.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/build/scripts/extract_docs.py b/build/scripts/extract_docs.py
index cdcf93105f..20e8311346 100644
--- a/build/scripts/extract_docs.py
+++ b/build/scripts/extract_docs.py
@@ -18,14 +18,21 @@ def main():
prefixes = ['{}{}'.format(os.path.normpath(p), os.path.sep) for p in args.skip_prefixes]
- for src in filter(lambda(p): os.path.basename(p) == 'preprocessed.tar.gz', args.docs):
- rel_dst = os.path.dirname(os.path.normpath(src))
- for prefix in prefixes:
- if src.startswith(prefix):
- rel_dst = rel_dst[len(prefix):]
- break
- assert not os.path.isabs(rel_dst)
- dest_dir = os.path.join(args.dest_dir, rel_dst)
+ def _valid_docslib(path):
+ base = os.path.basename(path)
+ return base.endswith(('.docslib', '.docslib.fake')) or base == 'preprocessed.tar.gz'
+
+ 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: