aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/tared_protoc.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-03-15 19:59:12 +0300
committeralexv-smirnov <alex@ydb.tech>2023-03-15 19:59:12 +0300
commit056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 (patch)
tree4740980126f32e3af7937ba0ca5f83e59baa4ab0 /build/scripts/tared_protoc.py
parent269126dcced1cc8b53eb4398b4a33e5142f10290 (diff)
downloadydb-056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11.tar.gz
add library/cpp/actors, ymake build to ydb oss export
Diffstat (limited to 'build/scripts/tared_protoc.py')
-rw-r--r--build/scripts/tared_protoc.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/build/scripts/tared_protoc.py b/build/scripts/tared_protoc.py
new file mode 100644
index 0000000000..7643e1dbfe
--- /dev/null
+++ b/build/scripts/tared_protoc.py
@@ -0,0 +1,31 @@
+import os
+import optparse
+import tarfile
+import contextlib
+import subprocess as sp
+
+
+def parse_args():
+ parser = optparse.OptionParser()
+ parser.disable_interspersed_args()
+ parser.add_option('--tar-output')
+ parser.add_option('--protoc-out-dir')
+ return parser.parse_args()
+
+
+def main():
+ opts, args = parse_args()
+ assert opts.tar_output
+ assert opts.protoc_out_dir
+
+ if not os.path.exists(opts.protoc_out_dir):
+ os.makedirs(opts.protoc_out_dir)
+
+ sp.check_call(args)
+
+ with contextlib.closing(tarfile.open(opts.tar_output, 'w')) as tf:
+ tf.add(opts.protoc_out_dir, arcname='')
+
+
+if __name__ == '__main__':
+ main()