Path: blob/main/system/lib/push_musl_changes.py
4150 views
#!/usr/bin/env python31# Copyright 2021 The Emscripten Authors. All rights reserved.2# Emscripten is available under two separate licenses, the MIT license and the3# University of Illinois/NCSA Open Source License. Both these licenses can be4# found in the LICENSE file.56# Copy local emscripten changes into the upstream musl tree.7# This is the logical inverse of update_musl.py which copies changes8# form the upstream musl tree into emscripten.910import glob11import os12import sys13import shutil1415script_dir = os.path.abspath(os.path.dirname(__file__))16local_dir = os.path.join(script_dir, 'libc', 'musl')17emscripten_root = os.path.dirname(os.path.dirname(script_dir))18default_musl_dir = os.path.join(os.path.dirname(emscripten_root), 'musl')192021def main():22if len(sys.argv) > 1:23upstream_root = os.path.join(os.path.abspath(sys.argv[1]))24else:25upstream_root = default_musl_dir26if not os.path.exists(upstream_root):27print(f'musl tree not found: {upstream_root}')28return 12930print(f'copying {local_dir} -> {upstream_root}')31shutil.copytree(local_dir, upstream_root, dirs_exist_ok=True)323334if __name__ == '__main__':35main()363738