From cb9bd8940b73eb10e832ed7cfca89bf86ca8e8b4 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 15 Jan 2025 17:26:14 -0800 Subject: Remove Include_make_built_files We're not using this anytime soon, so just remove it for now. Bug: 390269431 Test: m nothing Change-Id: I51bbf104dceabafc08d562cfecb31a845cb88d12 --- scripts/merge_directories.py | 60 -------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100755 scripts/merge_directories.py (limited to 'scripts/merge_directories.py') diff --git a/scripts/merge_directories.py b/scripts/merge_directories.py deleted file mode 100755 index 3f8631bab..000000000 --- a/scripts/merge_directories.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import os -import shutil -import sys - -def main(): - parser = argparse.ArgumentParser( - description="Given a list of directories, this script will copy the contents of all of " - "them into the first directory, erroring out if any duplicate files are found." - ) - parser.add_argument( - "--ignore-duplicates", - action="store_true", - help="Don't error out on duplicate files, just skip them. The file from the earliest " - "directory listed on the command line will be the winner." - ) - parser.add_argument( - "--file-list", - help="Path to a text file containing paths relative to in_dir. Only these paths will be " - "copied out of in_dir." - ) - parser.add_argument("out_dir") - parser.add_argument("in_dir") - args = parser.parse_args() - - if not os.path.isdir(args.out_dir): - sys.exit(f"error: {args.out_dir} must be a directory") - if not os.path.isdir(args.in_dir): - sys.exit(f"error: {args.in_dir} must be a directory") - - file_list = None - if args.file_list: - with open(file_list_file, "r") as f: - file_list = f.read().strip().splitlines() - - in_dir = args.in_dir - for root, dirs, files in os.walk(in_dir): - rel_root = os.path.relpath(root, in_dir) - dst_root = os.path.join(args.out_dir, rel_root) - made_parent_dirs = False - for f in files: - src = os.path.join(root, f) - dst = os.path.join(dst_root, f) - p = os.path.normpath(os.path.join(rel_root, f)) - if file_list is not None and p not in file_list: - continue - if os.path.lexists(dst): - if args.ignore_duplicates: - continue - sys.exit(f"error: {p} exists in both {args.out_dir} and {in_dir}") - - if not made_parent_dirs: - os.makedirs(dst_root, exist_ok=True) - made_parent_dirs = True - - shutil.copy2(src, dst, follow_symlinks=False) - -if __name__ == "__main__": - main() -- cgit v1.2.3-59-g8ed1b