@@ -31,29 +31,31 @@ def merge_file_lists(src_root_dirs, skip_files):
31
31
def overlapping_lipo_architectures (file_paths , lipo_executable ):
32
32
lipo_cmd = [lipo_executable , "-archs" ]
33
33
34
- known_archs = []
34
+ known_archs = []
35
35
for file in file_paths :
36
- archs = shell .capture (lipo_cmd + [file ], echo = False ).split (' ' )
36
+ archs = shell .capture (lipo_cmd + [file ], echo = False ).split (' ' )
37
37
for arch in archs :
38
- arch = arch .strip ()
38
+ arch = arch .strip ()
39
39
if arch in known_archs :
40
40
return True
41
41
known_archs .append (arch )
42
42
return False
43
43
44
+
44
45
# Copy the file
45
46
def copy_file (file , src_root_dirs , dest_root_dir ):
46
47
for dir in src_root_dirs :
47
- orig_file = os .path .join (dir , file )
48
+ orig_file = os .path .join (dir , file )
48
49
if os .path .exists (orig_file ):
49
- dest_file = os .path .join (
50
+ dest_file = os .path .join (
50
51
dest_root_dir , os .path .relpath (orig_file , dir ))
51
52
print ("-- Copying file %s" % dest_file )
52
53
shutil .copy2 (orig_file , dest_file )
53
54
return
54
55
55
56
print ("-- Warning: unable to copy file %s" % file )
56
57
58
+
57
59
def merge_lipo_files (src_root_dirs , file_list , dest_root_dir , verbose = False ,
58
60
lipo_executable = "lipo" ):
59
61
"""Recursively merges and runs lipo on all files from file_list in
@@ -105,13 +107,15 @@ def merge_lipo_files(src_root_dirs, file_list, dest_root_dir, verbose=False,
105
107
# copy the file directly.
106
108
copy_file (file , src_root_dirs , dest_root_dir )
107
109
else :
108
- # Multiple instances are different and executable, try lipo.
109
- if verbose :
110
- print ("-- Running lipo %s to %s" % (file_paths , dest_path ))
111
- else :
112
- print ("-- Running lipo %s" % dest_path )
113
- shell .call (lipo_cmd + ["-output" , dest_path ] + file_paths ,
114
- echo = verbose )
110
+ # Multiple instances are different and executable, try lipo.
111
+ if verbose :
112
+ print ("-- Running lipo %s to %s" %
113
+ (file_paths , dest_path ))
114
+ else :
115
+ print ("-- Running lipo %s" % dest_path )
116
+ shell .call ((lipo_cmd + ["-output" , dest_path ] +
117
+ file_paths ),
118
+ echo = verbose )
115
119
else :
116
120
# Multiple instances are different, and they're not executable.
117
121
print (
0 commit comments