OLD | NEW |
| (Empty) |
1 #!/usr/bin/python | |
2 | |
3 ''' Utility to upload debug symbols to the Google Breakpad Server ''' | |
4 | |
5 import os | |
6 import subprocess | |
7 import sys | |
8 | |
9 # Common Global Variables | |
10 DEBUG_BASE_PATH='/build' | |
11 DEBUG_SUBPATH='/usr/lib/debug' | |
12 DEBUG_EXT='.sym' | |
13 BP_UPLOAD=('../third_party/google-breakpad/' | |
14 'files/src/tools/linux/symupload/symupload') | |
15 | |
16 def CheckBinaryExists(): | |
17 if os.path.exists(BP_UPLOAD): | |
18 return True | |
19 return False | |
20 | |
21 def FindDebugFiles(): | |
22 | |
23 curdir = os.curdir | |
24 if not os.path.exists("/etc/debian_chroot"): | |
25 DEBUG_BASE_PATH= sys.argv[0] + '/../../chroot/build' | |
26 | |
27 files = [] | |
28 for dirpath, dirnames, filenames in os.walk(DEBUG_BASE_PATH): | |
29 filenames[:] = [os.path.join(dirpath, fname) | |
30 for fname in filenames if fname.endswith(DEBUG_EXT)] | |
31 files.extend(filenames) | |
32 return files | |
33 | |
34 def Upload(filenames=[]): | |
35 | |
36 for filename in filenames: | |
37 print 'executing..' + BP_UPLOAD + ' ' + filename | |
38 retval = subprocess.call([BPUPLOAD, filename]) | |
39 print retval | |
40 print 'done.' | |
41 | |
42 def Main(): | |
43 if not CheckBinaryExists(): | |
44 print "Could not find Breakpad Upload Binary at : %s " % BP_UPLOAD | |
45 return | |
46 | |
47 filenames = FindDebugFiles() | |
48 Upload(filenames) | |
49 | |
50 if __name__ == '__main__': | |
51 Main() | |
OLD | NEW |