diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/make_manifest_from_bf.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'build/scripts/make_manifest_from_bf.py')
-rw-r--r-- | build/scripts/make_manifest_from_bf.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/build/scripts/make_manifest_from_bf.py b/build/scripts/make_manifest_from_bf.py new file mode 100644 index 0000000000..bfea3ba3de --- /dev/null +++ b/build/scripts/make_manifest_from_bf.py @@ -0,0 +1,28 @@ +import sys +import zipfile +import os +import re + + +def prepare_path(path): + return ('file:/' + path.lstrip('/')) if os.path.isabs(path) else path + + +def main(args): + bf, mf = args[0], args[1] + if not os.path.exists(os.path.dirname(mf)): + os.makedirs(os.path.dirname(mf)) + with open(bf) as f: + class_path = f.read().strip() + class_path = ' '.join(map(prepare_path, class_path.split('\n'))) + with zipfile.ZipFile(mf, 'w') as zf: + lines = [] + while class_path: + lines.append(class_path[:60]) + class_path = class_path[60:] + if lines: + zf.writestr('META-INF/MANIFEST.MF', 'Manifest-Version: 1.0\nClass-Path: \n ' + '\n '.join(lines) + ' \n\n') + + +if __name__ == '__main__': + main(sys.argv[1:]) |