@@ -27,17 +27,6 @@ def merge_file_lists(src_root_dirs, skip_files):
27
27
return file_list
28
28
29
29
30
- # Check whether the given file occurs in any of the subpaths provided.
31
- def in_any_subpath (file , subpaths ):
32
- current_path = file
33
- while current_path != '' :
34
- current_dir = os .path .dirname (current_path )
35
- if current_dir in subpaths :
36
- return True
37
- current_path = current_dir
38
-
39
- return False
40
-
41
30
# Determine if the file paths contain any overlapping architectures.
42
31
def overlapping_lipo_architectures (file_paths , lipo_executable ):
43
32
lipo_cmd = [lipo_executable , "-archs" ]
@@ -65,8 +54,8 @@ def copy_file(file, src_root_dirs, dest_root_dir):
65
54
66
55
print ("-- Warning: unable to copy file %s" % file )
67
56
68
- def merge_lipo_files (src_root_dirs , file_list , copy_verbatim_subpaths ,
69
- dest_root_dir , verbose = False , lipo_executable = "lipo" ):
57
+ def merge_lipo_files (src_root_dirs , file_list , dest_root_dir , verbose = False ,
58
+ lipo_executable = "lipo" ):
70
59
"""Recursively merges and runs lipo on all files from file_list in
71
60
src_root_dirs to destRoorDir.
72
61
@@ -76,9 +65,7 @@ def merge_lipo_files(src_root_dirs, file_list, copy_verbatim_subpaths,
76
65
it's lipo'ed together from all src_root_dirs into a fat binary.
77
66
78
67
Any path in file_list that's a directory in src_root_dirs results in a
79
- corresponding subdirectory in dest_root_dir. If the subdirectory path
80
- matches copy_verbatim_subpaths, the whole subdirectory is recursively
81
- copied verbatim.
68
+ corresponding subdirectory in dest_root_dir.
82
69
"""
83
70
lipo_cmd = [lipo_executable , "-create" ]
84
71
@@ -113,10 +100,7 @@ def merge_lipo_files(src_root_dirs, file_list, copy_verbatim_subpaths,
113
100
# All instances are identical, just copy the unique file.
114
101
copy_file (file , src_root_dirs , dest_root_dir )
115
102
elif all ([os .access (item , os .X_OK ) for item in file_paths ]):
116
- if (overlapping_lipo_architectures (file_paths ,
117
- lipo_executable ) and
118
- in_any_subpath (file , copy_verbatim_subpaths )):
119
- # We're allowed to copy verbatim from this subpath, and
103
+ if overlapping_lipo_architectures (file_paths , lipo_executable ):
120
104
# lipo will fail due to overlapping architectures, so
121
105
# copy the file directly.
122
106
copy_file (file , src_root_dirs , dest_root_dir )
@@ -148,10 +132,6 @@ If all the copies of the file in the source directories are the same,
148
132
the file is copied directly to the destination. If there are different
149
133
files in different directories, but the files are executable,
150
134
lipo is run to merge the files together. Otherwise, a warning is produced.
151
-
152
- Use --copy-subdirs to override normal logic and copy certain sub directory
153
- paths verbatim. This is useful if some subdirectories already contain fat
154
- binaries.
155
135
""" )
156
136
157
137
parser .add_argument ("-v" , "--verbose" , action = 'store_true' ,
@@ -163,10 +143,6 @@ binaries.
163
143
default = ".DS_Store" ,
164
144
help = "Files to ignore and skip merge/copy, default " +
165
145
"is \" .DS_Store\" " )
166
- parser .add_argument ("--copy-subdirs" , metavar = "<subdirs-to-copy-verbatim>" ,
167
- default = "" ,
168
- help = "Optional list of subdirectory paths that " +
169
- "should be copied verbatim" )
170
146
171
147
required_group = parser .add_argument_group ("required arguments" )
172
148
required_group .add_argument ("--destination" , metavar = "<dest-path>" ,
@@ -179,17 +155,15 @@ binaries.
179
155
args = parser .parse_args ()
180
156
181
157
skip_files = args .skip_files .split ()
182
- copy_verbatim_subpaths = [
183
- subdir .strip ('/' ) for subdir in args .copy_subdirs .split ()]
184
158
185
159
file_list = merge_file_lists (args .src_root_dirs , skip_files )
186
160
187
161
if args .verbose :
188
162
print ("Discovered files and dirs: %s" % file_list )
189
163
190
164
merge_lipo_files (
191
- args .src_root_dirs , file_list , copy_verbatim_subpaths ,
192
- args .destination , args . verbose , args . lipo )
165
+ args .src_root_dirs , file_list , args . destination , args . verbose ,
166
+ args .lipo )
193
167
194
168
return 0
195
169
0 commit comments