OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Usage: strip_save_dsym <whatever-arguments-you-would-pass-to-strip> | 7 # Usage: strip_save_dsym <whatever-arguments-you-would-pass-to-strip> |
8 # | 8 # |
9 # strip_save_dsym is a wrapper around the standard strip utility. Given an | 9 # strip_save_dsym is a wrapper around the standard strip utility. Given an |
10 # input Mach-O file, strip_save_dsym will save a copy of the file in a "fake" | 10 # input Mach-O file, strip_save_dsym will save a copy of the file in a "fake" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 root_name = os.path.basename(dsym)[:-5] # whatever.dSYM without .dSYM | 209 root_name = os.path.basename(dsym)[:-5] # whatever.dSYM without .dSYM |
210 uuid_dict = "" | 210 uuid_dict = "" |
211 for arch in sorted(uuids): | 211 for arch in sorted(uuids): |
212 uuid_dict += "\t\t\t<key>" + arch + "</key>\n"\ | 212 uuid_dict += "\t\t\t<key>" + arch + "</key>\n"\ |
213 "\t\t\t<string>" + uuids[arch] + "</string>\n" | 213 "\t\t\t<string>" + uuids[arch] + "</string>\n" |
214 info_dict = { | 214 info_dict = { |
215 "root_name": root_name, | 215 "root_name": root_name, |
216 "uuid_dict": uuid_dict, | 216 "uuid_dict": uuid_dict, |
217 } | 217 } |
218 info_contents = info_template % info_dict | 218 info_contents = info_template % info_dict |
219 info_file = os.path.join(dsym, "Info.plist") | 219 info_file = os.path.join(dsym, "Contents", "Info.plist") |
220 info_fd = open(info_file, "w") | 220 info_fd = open(info_file, "w") |
221 info_fd.write(info_contents) | 221 info_fd.write(info_contents) |
222 info_fd.close() | 222 info_fd.close() |
223 | 223 |
224 return True | 224 return True |
225 | 225 |
226 # For a Mach-O file, determines where the .dSYM bundle should be located. If | 226 # For a Mach-O file, determines where the .dSYM bundle should be located. If |
227 # the bundle does not exist or has a modification time older than the Mach-O | 227 # the bundle does not exist or has a modification time older than the Mach-O |
228 # file, calls make_fake_dsym to create a fake .dSYM bundle there, then strips | 228 # file, calls make_fake_dsym to create a fake .dSYM bundle there, then strips |
229 # the Mach-O file and sets the modification time on the .dSYM bundle and Mach-O | 229 # the Mach-O file and sets the modification time on the .dSYM bundle and Mach-O |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 print >> sys.stderr, "Nothing to strip" | 304 print >> sys.stderr, "Nothing to strip" |
305 return 1 | 305 return 1 |
306 | 306 |
307 if not strip_and_make_fake_dsym(macho): | 307 if not strip_and_make_fake_dsym(macho): |
308 return 1 | 308 return 1 |
309 | 309 |
310 return 0 | 310 return 0 |
311 | 311 |
312 if __name__ == '__main__': | 312 if __name__ == '__main__': |
313 sys.exit(main(sys.argv)) | 313 sys.exit(main(sys.argv)) |
OLD | NEW |