Skip to content

Commit 92b03b9

Browse files
committed
[recursive-lipo] Also install broken symlinks
1 parent 7c6fea6 commit 92b03b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/recursive-lipo

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ def overlapping_lipo_architectures(file_paths, lipo_executable):
4141
known_archs.append(arch)
4242
return False
4343

44+
# Determine whether we should consider a file as installable.
45+
def is_installable(file):
46+
return os.path.exists(file) or os.path.islink(file)
4447

4548
# Determine the path to the first file and where it should be installed.
4649
def get_first_file_and_dest_path(file, src_root_dirs, dest_root_dir):
4750
for dir in src_root_dirs:
4851
orig_file = os.path.join(dir, file)
49-
if os.path.exists(orig_file):
52+
if is_installable(orig_file):
5053
dest_path = os.path.join(
5154
dest_root_dir, os.path.relpath(orig_file, dir))
5255
return (orig_file, dest_path)
@@ -72,7 +75,7 @@ def merge_lipo_files(src_root_dirs, file_list, dest_root_dir, verbose=False,
7275
for file in file_list:
7376
file_paths = [
7477
os.path.join(dir, file) for dir in src_root_dirs
75-
if os.path.exists(os.path.join(dir, file))]
78+
if is_installable(os.path.join(dir, file))]
7679
if len(file_paths) == 0:
7780
print("-- Warning: Can't locate source file %s" % file)
7881
continue

0 commit comments

Comments
 (0)