diff options
author | spreis <spreis@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
commit | b49848d6e361b76904f094b7d5e10d6edea75afe (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /build/scripts | |
parent | bcd1126cbd5d445cd0665d295198aa39c6ab8cbe (diff) | |
download | ydb-b49848d6e361b76904f094b7d5e10d6edea75afe.tar.gz |
Restoring authorship annotation for <spreis@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'build/scripts')
-rw-r--r-- | build/scripts/c_templates/ya.make | 4 | ||||
-rwxr-xr-x | build/scripts/fetch_from.py | 2 | ||||
-rw-r--r-- | build/scripts/fetch_from_archive.py | 66 | ||||
-rw-r--r-- | build/scripts/fetch_from_external.py | 98 | ||||
-rwxr-xr-x | build/scripts/fetch_from_sandbox.py | 14 | ||||
-rw-r--r-- | build/scripts/fs_tools.py | 12 | ||||
-rw-r--r-- | build/scripts/gen_java_codenav_entry.py | 2 | ||||
-rw-r--r-- | build/scripts/generate_mf.py | 4 | ||||
-rw-r--r-- | build/scripts/link_dyn_lib.py | 6 | ||||
-rw-r--r-- | build/scripts/link_exe.py | 2 | ||||
-rw-r--r-- | build/scripts/run_msvc_wine.py | 6 | ||||
-rw-r--r-- | build/scripts/vcs_info.py | 18 | ||||
-rw-r--r-- | build/scripts/yndexer.py | 2 |
13 files changed, 118 insertions, 118 deletions
diff --git a/build/scripts/c_templates/ya.make b/build/scripts/c_templates/ya.make index 66d901609e..b395e11021 100644 --- a/build/scripts/c_templates/ya.make +++ b/build/scripts/c_templates/ya.make @@ -1,5 +1,5 @@ -OWNER(g:ymake) - +OWNER(g:ymake) + LIBRARY(dummy-vcs) NO_PLATFORM() diff --git a/build/scripts/fetch_from.py b/build/scripts/fetch_from.py index 2f9c95ee96..db4fea50bf 100755 --- a/build/scripts/fetch_from.py +++ b/build/scripts/fetch_from.py @@ -210,7 +210,7 @@ def fetch_url(url, unpack, resource_file_name, expected_md5=None, expected_sha1= tmp_file_name = uniq_string_generator() request = urllib2.Request(url, headers={'User-Agent': make_user_agent()}) - req = retry.retry_func(lambda: urllib2.urlopen(request, timeout=30), tries=tries, delay=5, backoff=1.57079) + req = retry.retry_func(lambda: urllib2.urlopen(request, timeout=30), tries=tries, delay=5, backoff=1.57079) logging.debug('Headers: %s', req.headers.headers) expected_file_size = int(req.headers['Content-Length']) real_md5 = hashlib.md5() diff --git a/build/scripts/fetch_from_archive.py b/build/scripts/fetch_from_archive.py index 762e0a16e1..57aff91b5e 100644 --- a/build/scripts/fetch_from_archive.py +++ b/build/scripts/fetch_from_archive.py @@ -1,36 +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 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) diff --git a/build/scripts/fetch_from_external.py b/build/scripts/fetch_from_external.py index 83f0416ca1..d4ed6f4221 100644 --- a/build/scripts/fetch_from_external.py +++ b/build/scripts/fetch_from_external.py @@ -1,60 +1,60 @@ import sys import json -import os.path -import fetch_from -import argparse -import logging +import os.path +import fetch_from +import argparse +import logging -def parse_args(): - parser = argparse.ArgumentParser() - fetch_from.add_common_arguments(parser) - parser.add_argument('--external-file', required=True) - parser.add_argument('--custom-fetcher') - parser.add_argument('--resource-file') - return parser.parse_args() +def parse_args(): + parser = argparse.ArgumentParser() + fetch_from.add_common_arguments(parser) + parser.add_argument('--external-file', required=True) + parser.add_argument('--custom-fetcher') + parser.add_argument('--resource-file') + return parser.parse_args() -def main(args): - external_file = args.external_file.rstrip('.external') - if os.path.isfile(args.resource_file): +def main(args): + external_file = args.external_file.rstrip('.external') + if os.path.isfile(args.resource_file): fetch_from.process(args.resource_file, os.path.basename(args.resource_file), args, False) - return - - error = None - try: - with open(args.external_file) as f: - js = json.load(f) - - if js['storage'] == 'SANDBOX': - import fetch_from_sandbox as ffsb - del args.external_file - args.resource_id = js['resource_id'] - ffsb.main(args) - elif js['storage'] == 'MDS': - import fetch_from_mds as fmds - del args.external_file - args.key = js['resource_id'] - fmds.main(args) - else: - error = 'Unsupported storage in {}'.format(external_file) - except: - logging.error('Invalid external file: {}'.format(external_file)) - raise - if error: - raise Exception(error) - - + return + + error = None + try: + with open(args.external_file) as f: + js = json.load(f) + + if js['storage'] == 'SANDBOX': + import fetch_from_sandbox as ffsb + del args.external_file + args.resource_id = js['resource_id'] + ffsb.main(args) + elif js['storage'] == 'MDS': + import fetch_from_mds as fmds + del args.external_file + args.key = js['resource_id'] + fmds.main(args) + else: + error = 'Unsupported storage in {}'.format(external_file) + except: + logging.error('Invalid external file: {}'.format(external_file)) + raise + if error: + raise Exception(error) + + 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() + 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) diff --git a/build/scripts/fetch_from_sandbox.py b/build/scripts/fetch_from_sandbox.py index bc6430963b..a99542e174 100755 --- a/build/scripts/fetch_from_sandbox.py +++ b/build/scripts/fetch_from_sandbox.py @@ -170,15 +170,15 @@ def fetch(resource_id, custom_fetcher): if custom_fetcher: yield lambda: fetch_via_script(custom_fetcher, resource_id) - - # Don't try too hard here: we will get back to proxy later on - yield lambda: fetch_from.fetch_url(proxy_link, False, resource_file_name, expected_md5, tries=2) + + # Don't try too hard here: we will get back to proxy later on + yield lambda: fetch_from.fetch_url(proxy_link, False, resource_file_name, expected_md5, tries=2) for x in get_storage_links(): - # Don't spend too much time connecting single host - yield lambda: fetch_from.fetch_url(x, False, resource_file_name, expected_md5, tries=1) + # Don't spend too much time connecting single host + yield lambda: fetch_from.fetch_url(x, False, resource_file_name, expected_md5, tries=1) if mds_link is not None: - # Don't try too hard here: we will get back to MDS later on - yield lambda: fetch_from.fetch_url(mds_link, True, resource_file_name, expected_md5, tries=2) + # Don't try too hard here: we will get back to MDS later on + yield lambda: fetch_from.fetch_url(mds_link, True, resource_file_name, expected_md5, tries=2) yield lambda: fetch_from.fetch_url(proxy_link, False, resource_file_name, expected_md5) if mds_link is not None: yield lambda: fetch_from.fetch_url(mds_link, True, resource_file_name, expected_md5) diff --git a/build/scripts/fs_tools.py b/build/scripts/fs_tools.py index d2d6209822..dec4c349c8 100644 --- a/build/scripts/fs_tools.py +++ b/build/scripts/fs_tools.py @@ -82,13 +82,13 @@ if __name__ == '__main__': link_or_copy(args[0], args[1]) elif mode == 'link_or_copy_to_dir': assert len(args) > 1 - start = 0 - if args[0] == '--no-check': - if args == 2: - sys.exit() - start = 1 + start = 0 + if args[0] == '--no-check': + if args == 2: + sys.exit() + start = 1 dst = args[-1] - for src in args[start:-1]: + for src in args[start:-1]: link_or_copy(src, os.path.join(dst, os.path.basename(src))) elif mode == 'cat': with open(args[0], 'w') as dst: diff --git a/build/scripts/gen_java_codenav_entry.py b/build/scripts/gen_java_codenav_entry.py index e2fd871770..ff0a5c737d 100644 --- a/build/scripts/gen_java_codenav_entry.py +++ b/build/scripts/gen_java_codenav_entry.py @@ -44,7 +44,7 @@ def just_do_it(java, kythe, kythe_to_proto, out_name, binding_only, kindexes): print >> sys.stderr, '[INFO] Preprocessing execution time:', (datetime.datetime.now() - preprocess_start).total_seconds(), 'seconds' print >> sys.stderr, '[INFO] Total execution time:', (datetime.datetime.now() - start).total_seconds(), 'seconds' - + if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--java", help="java path") diff --git a/build/scripts/generate_mf.py b/build/scripts/generate_mf.py index 4dbe95e26a..a44a969980 100644 --- a/build/scripts/generate_mf.py +++ b/build/scripts/generate_mf.py @@ -5,7 +5,7 @@ import os import sys import io -import process_command_files as pcf +import process_command_files as pcf class BadMfError(Exception): pass @@ -23,7 +23,7 @@ def process_quotes(s): def parse_args(): - args = pcf.get_args(sys.argv[1:]) + args = pcf.get_args(sys.argv[1:]) lics, peers, free_args, credits = [], [], [], [] current_list = free_args for a in args: diff --git a/build/scripts/link_dyn_lib.py b/build/scripts/link_dyn_lib.py index 510728910e..23487f5c1e 100644 --- a/build/scripts/link_dyn_lib.py +++ b/build/scripts/link_dyn_lib.py @@ -150,9 +150,9 @@ def fix_cmd(arch, musl, c): if p.endswith('.supp'): return [] - if p.endswith('.pkg.fake'): - return [] - + if p.endswith('.pkg.fake'): + return [] + return [p] return sum((do_fix(x) for x in c), []) diff --git a/build/scripts/link_exe.py b/build/scripts/link_exe.py index 0ab4ef94a3..f469e3b442 100644 --- a/build/scripts/link_exe.py +++ b/build/scripts/link_exe.py @@ -19,7 +19,7 @@ musl_libs = '-lc', '-lcrypt', '-ldl', '-lm', '-lpthread', '-lrt', '-lutil' def fix_cmd(musl, c): - return [i for i in c if (not musl or i not in musl_libs) and not i.endswith('.ios.interface') and not i.endswith('.pkg.fake')] + return [i for i in c if (not musl or i not in musl_libs) and not i.endswith('.ios.interface') and not i.endswith('.pkg.fake')] def gen_default_suppressions(inputs, output, source_root): diff --git a/build/scripts/run_msvc_wine.py b/build/scripts/run_msvc_wine.py index 1799eb5276..439d1f8831 100644 --- a/build/scripts/run_msvc_wine.py +++ b/build/scripts/run_msvc_wine.py @@ -1,6 +1,6 @@ import sys import os -import re +import re import subprocess import signal import time @@ -202,8 +202,8 @@ def is_good_file(p): if os.path.getsize(p) < 300: return False - asm_pattern = re.compile('asm(\.\w+)?\.obj$') - if asm_pattern.search(p): + asm_pattern = re.compile('asm(\.\w+)?\.obj$') + if asm_pattern.search(p): pass elif p.endswith('.obj'): with open(p, 'rb') as f: diff --git a/build/scripts/vcs_info.py b/build/scripts/vcs_info.py index bcf2a053ed..319d1b4631 100644 --- a/build/scripts/vcs_info.py +++ b/build/scripts/vcs_info.py @@ -45,15 +45,15 @@ class _Formatting(object): return strval.replace(r'\n', '\\n"\\\n' + indent + '"') @staticmethod - def escape_trigraphs(strval): - return strval.replace(r'?', '\\?') - - @staticmethod + def escape_trigraphs(strval): + return strval.replace(r'?', '\\?') + + @staticmethod def escaped_define(strkey, val): name = "#define " + strkey + " " if _Formatting.is_str(val): define = "\"" + _Formatting.escape_line_feed( - _Formatting.escape_trigraphs(_Formatting.escape_special_symbols(val))) + "\"" + _Formatting.escape_trigraphs(_Formatting.escape_special_symbols(val))) + "\"" else: define = str(val) return name + define @@ -68,8 +68,8 @@ class _Formatting(object): def get_default_json(): return json.loads('''{ - "ARCADIA_SOURCE_HG_HASH": "0000000000000000000000000000000000000000", - "ARCADIA_SOURCE_LAST_AUTHOR": "<UNKNOWN>", + "ARCADIA_SOURCE_HG_HASH": "0000000000000000000000000000000000000000", + "ARCADIA_SOURCE_LAST_AUTHOR": "<UNKNOWN>", "ARCADIA_SOURCE_LAST_CHANGE": -1, "ARCADIA_SOURCE_PATH": "/", "ARCADIA_SOURCE_REVISION": -1, @@ -79,8 +79,8 @@ def get_default_json(): "BUILD_TIMESTAMP": 0, "BUILD_HOST": "localhost", "BUILD_USER": "nobody", - "PROGRAM_VERSION": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n\\n", - "SCM_DATA": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n", + "PROGRAM_VERSION": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n\\n", + "SCM_DATA": "Arc info:\\n Branch: unknown-vcs-branch\\n Commit: 0000000000000000000000000000000000000000\\n Author: <UNKNOWN>\\n Summary: No VCS\\n", "VCS": "arc", "ARCADIA_PATCH_NUMBER": 0, "ARCADIA_TAG": "" diff --git a/build/scripts/yndexer.py b/build/scripts/yndexer.py index 15cb2cedf2..a38e28ba99 100644 --- a/build/scripts/yndexer.py +++ b/build/scripts/yndexer.py @@ -62,7 +62,7 @@ if __name__ == '__main__': yndexer, input_file, '-pb2', '-i', 'arc::{}'.format(arc_root), - '-i', 'build::{}'.format(build_root), + '-i', 'build::{}'.format(build_root), '-i', '.IGNORE::/', '-o', os.path.dirname(output_file), '-n', os.path.basename(output_file).rsplit('.ydx.pb2', 1)[0], |