aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/tar_sources.py
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2022-08-19 15:00:44 +0300
committerthegeorg <thegeorg@yandex-team.com>2022-08-19 15:00:44 +0300
commitad2a1b622d2bf6cf025982846153d9c4c791af2c (patch)
tree8906addc18a494ece9dff28b2701a37ef4b52bf8 /build/scripts/tar_sources.py
parent7b61b052f3baa7e43edca48c373f95b5e5f1c845 (diff)
downloadydb-ad2a1b622d2bf6cf025982846153d9c4c791af2c.tar.gz
Let cmake export determine which build/scripts are mandatory
Diffstat (limited to 'build/scripts/tar_sources.py')
-rw-r--r--build/scripts/tar_sources.py41
1 files changed, 0 insertions, 41 deletions
diff --git a/build/scripts/tar_sources.py b/build/scripts/tar_sources.py
deleted file mode 100644
index 54e2839a69..0000000000
--- a/build/scripts/tar_sources.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import argparse
-import os
-import tarfile
-
-
-def parse_args():
- parser = argparse.ArgumentParser()
- parser.add_argument('--exts', nargs='*', default=None)
- parser.add_argument('--flat', action='store_true')
- parser.add_argument('--input', required=True)
- parser.add_argument('--output', required=True)
- parser.add_argument('--prefix', default=None)
-
- return parser.parse_args()
-
-
-def main():
- args = parse_args()
-
- py_srcs = []
- for root, _, files in os.walk(args.input):
- for f in files:
- if not args.exts or f.endswith(tuple(args.exts)):
- py_srcs.append(os.path.join(root, f))
-
- compression_mode = ''
- if args.output.endswith(('.tar.gz', '.tgz')):
- compression_mode = 'gz'
- elif args.output.endswith('.bzip2'):
- compression_mode = 'bz2'
-
- with tarfile.open(args.output, 'w:{}'.format(compression_mode)) as out:
- for f in py_srcs:
- arcname = os.path.basename(f) if args.flat else os.path.relpath(f, args.input)
- if args.prefix:
- arcname = os.path.join(args.prefix, arcname)
- out.add(f, arcname=arcname)
-
-
-if __name__ == '__main__':
- main()