@@ -338,15 +338,14 @@ def extractFile(archive, filename, instance):
338
338
339
339
340
340
def handleArchiveDarwin (pArgs ):
341
-
342
341
originalDir = os .getcwd () # This will be the destination
343
342
344
343
pArgs .arCmd .append (pArgs .inputFile )
345
344
346
345
# Make temporary directory to extract objects to
347
346
tempDir = ''
348
- bitCodeFiles = [ ]
349
- retCode = 0
347
+ bitCodeFiles = []
348
+
350
349
try :
351
350
352
351
@@ -374,30 +373,29 @@ def handleArchiveDarwin(pArgs):
374
373
_logger .debug (2 )
375
374
376
375
# Iterate over objects and examine their bitcode inserts
377
- for (root , dirs , files ) in os .walk (tempDir ):
378
- _logger .debug ('Exploring "{0}"' .format (root ))
379
- for f in files :
380
- fPath = os .path .join (root , f )
381
- if FileType .getFileType (fPath ) == pArgs .fileType :
382
-
383
- # Extract bitcode locations from object
384
- contents = pArgs .extractor (fPath )
385
-
386
- for bcFile in contents :
387
- if bcFile != '' :
388
- if not os .path .exists (bcFile ):
389
- _logger .warning ('{0} lists bitcode library "{1}" but it could not be found' .format (f , bcFile ))
390
- else :
391
- bitCodeFiles .append (bcFile )
392
- else :
393
- _logger .info ('Ignoring file "{0}" in archive' .format (f ))
394
-
395
- _logger .info ('Found the following bitcode file names to build bitcode archive:\n {0}' .format (
396
- pprint .pformat (bitCodeFiles )))
376
+ for (root , _ , files ) in os .walk (tempDir ):
377
+ _logger .debug ('Exploring "%s"' , root )
378
+ for f in files :
379
+ fPath = os .path .join (root , f )
380
+ if FileType .getFileType (fPath ) == pArgs .fileType :
381
+
382
+ # Extract bitcode locations from object
383
+ contents = pArgs .extractor (fPath )
384
+
385
+ for bcFile in contents :
386
+ if bcFile != '' :
387
+ if not os .path .exists (bcFile ):
388
+ _logger .warning ('%s lists bitcode library "%s" but it could not be found' , f , bcFile )
389
+ else :
390
+ bitCodeFiles .append (bcFile )
391
+ else :
392
+ _logger .info ('Ignoring file "%s" in archive' , f )
393
+
394
+ _logger .info ('Found the following bitcode file names to build bitcode archive:\n %s' , pprint .pformat (bitCodeFiles ))
397
395
398
396
finally :
399
397
# Delete the temporary folder
400
- _logger .debug ('Deleting temporary folder "{0}"' . format ( tempDir ) )
398
+ _logger .debug ('Deleting temporary folder "%s"' , tempDir )
401
399
shutil .rmtree (tempDir )
402
400
403
401
#write the manifest file if asked for
0 commit comments