Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: build/android/gyp/write_ordered_libraries.py

Issue 106923002: Don't use sys.exit() in build_utils.CheckCallDie(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 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 """Writes dependency ordered list of native libraries. 7 """Writes dependency ordered list of native libraries.
8 8
9 The list excludes any Android system libraries, as those are not bundled with 9 The list excludes any Android system libraries, as those are not bundled with
10 the APK. 10 the APK.
(...skipping 29 matching lines...) Expand all
40 def IsSystemLibrary(library_name): 40 def IsSystemLibrary(library_name):
41 # If the library doesn't exist in the libraries directory, assume that it is 41 # If the library doesn't exist in the libraries directory, assume that it is
42 # an Android system library. 42 # an Android system library.
43 return not os.path.exists(FullLibraryPath(library_name)) 43 return not os.path.exists(FullLibraryPath(library_name))
44 44
45 45
46 def CallReadElf(library_or_executable): 46 def CallReadElf(library_or_executable):
47 readelf_cmd = [_options.readelf, 47 readelf_cmd = [_options.readelf,
48 '-d', 48 '-d',
49 library_or_executable] 49 library_or_executable]
50 return build_utils.CheckCallDie(readelf_cmd, suppress_output=True) 50 return build_utils.CheckOutput(readelf_cmd)
51 51
52 52
53 def GetDependencies(library_or_executable): 53 def GetDependencies(library_or_executable):
54 elf = CallReadElf(library_or_executable) 54 elf = CallReadElf(library_or_executable)
55 return set(_library_re.findall(elf)) 55 return set(_library_re.findall(elf))
56 56
57 57
58 def GetNonSystemDependencies(library_name): 58 def GetNonSystemDependencies(library_name):
59 all_deps = GetDependencies(FullLibraryPath(library_name)) 59 all_deps = GetDependencies(FullLibraryPath(library_name))
60 return set((lib for lib in all_deps if not IsSystemLibrary(lib))) 60 return set((lib for lib in all_deps if not IsSystemLibrary(lib)))
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 build_utils.WriteJson(libraries, _options.output, only_if_changed=True) 116 build_utils.WriteJson(libraries, _options.output, only_if_changed=True)
117 117
118 if _options.stamp: 118 if _options.stamp:
119 build_utils.Touch(_options.stamp) 119 build_utils.Touch(_options.stamp)
120 120
121 121
122 if __name__ == '__main__': 122 if __name__ == '__main__':
123 sys.exit(main(sys.argv)) 123 sys.exit(main(sys.argv))
124 124
125 125
OLDNEW
« build/android/gyp/ant.py ('K') | « build/android/gyp/util/build_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698