aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/fetch_from_archive.py
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /build/scripts/fetch_from_archive.py
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'build/scripts/fetch_from_archive.py')
-rw-r--r--build/scripts/fetch_from_archive.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/build/scripts/fetch_from_archive.py b/build/scripts/fetch_from_archive.py
new file mode 100644
index 00000000000..57aff91b5e5
--- /dev/null
+++ b/build/scripts/fetch_from_archive.py
@@ -0,0 +1,36 @@
+import os
+import sys
+import logging
+import argparse
+
+import fetch_from
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ fetch_from.add_common_arguments(parser)
+ parser.add_argument('--file-name', required=True)
+ parser.add_argument('--archive', required=True)
+
+ return parser.parse_args()
+
+def main(args):
+ archive = args.archive
+ file_name = args.file_name.rstrip('-')
+
+ fetch_from.process(archive, file_name, args, remove=False)
+
+
+if __name__ == '__main__':
+ args = parse_args()
+ fetch_from.setup_logging(args, os.path.basename(__file__))
+
+ try:
+ main(args)
+ except Exception as e:
+ logging.exception(e)
+ print >>sys.stderr, open(args.abs_log_path).read()
+ sys.stderr.flush()
+
+ import error
+ sys.exit(error.ExitCodes.INFRASTRUCTURE_ERROR if fetch_from.is_temporary(e) else 1)