Skip to content

Commit 4ca5d1e

Browse files
authored
Merge pull request #62537 from DougGregor/recursive-lipo-broken-symlinks
2 parents e5d2475 + 3eb96d5 commit 4ca5d1e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utils/recursive-lipo

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ def overlapping_lipo_architectures(file_paths, lipo_executable):
4242
return False
4343

4444

45+
# Determine whether we should consider a file as installable.
46+
def is_installable(file):
47+
return os.path.exists(file) or os.path.islink(file)
48+
49+
4550
# Determine the path to the first file and where it should be installed.
4651
def get_first_file_and_dest_path(file, src_root_dirs, dest_root_dir):
4752
for dir in src_root_dirs:
4853
orig_file = os.path.join(dir, file)
49-
if os.path.exists(orig_file):
54+
if is_installable(orig_file):
5055
dest_path = os.path.join(
5156
dest_root_dir, os.path.relpath(orig_file, dir))
5257
return (orig_file, dest_path)
@@ -72,7 +77,7 @@ def merge_lipo_files(src_root_dirs, file_list, dest_root_dir, verbose=False,
7277
for file in file_list:
7378
file_paths = [
7479
os.path.join(dir, file) for dir in src_root_dirs
75-
if os.path.exists(os.path.join(dir, file))]
80+
if is_installable(os.path.join(dir, file))]
7681
if len(file_paths) == 0:
7782
print("-- Warning: Can't locate source file %s" % file)
7883
continue

0 commit comments

Comments
 (0)