Skip to content
Snippets Groups Projects
Commit 792b9d38 authored by brad kittenbrink's avatar brad kittenbrink
Browse files

Added extra error checking to generate_breakpad_symbols.py

so the failure in copy_l_viewer_manifest (fixed in changeset 4ae8723c7d33) won't be so silent in the future.
parent 5d68254c
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
import itertools import itertools
import os import os
import sys import sys
import shlex
import subprocess import subprocess
import tarfile import tarfile
import StringIO import StringIO
...@@ -44,11 +45,27 @@ ...@@ -44,11 +45,27 @@
def usage(): def usage():
print >>sys.stderr, "usage: %s viewer_dir viewer_exes libs_suffix dump_syms_tool viewer_symbol_file" % sys.argv[0] print >>sys.stderr, "usage: %s viewer_dir viewer_exes libs_suffix dump_syms_tool viewer_symbol_file" % sys.argv[0]
class MissingModuleError(Exception):
def __init__(self, modules):
Exception.__init__(self, "Failed to find required modules: %r" % modules)
self.modules = modules
def main(viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file): def main(viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file):
# print "generate_breakpad_symbols: %s" % str((viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file)) # print "generate_breakpad_symbols: %s" % str((viewer_dir, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file))
# split up list of viewer_exes
# "'Second Life' SLPlugin" becomes ['Second Life', 'SLPlugin']
viewer_exes = shlex.split(viewer_exes)
found_required = dict()
for required in viewer_exes:
found_required[required] = False
def matches(f): def matches(f):
return f in viewer_exes or fnmatch.fnmatch(f, libs_suffix) if f in viewer_exes:
found_required[f] = True
return True
return fnmatch.fnmatch(f, libs_suffix)
def list_files(): def list_files():
for (dirname, subdirs, filenames) in os.walk(viewer_dir): for (dirname, subdirs, filenames) in os.walk(viewer_dir):
...@@ -81,6 +98,12 @@ def dump_module(m): ...@@ -81,6 +98,12 @@ def dump_module(m):
else: else:
print >>sys.stderr, "warning: failed to dump symbols for '%s': %s" % (filename, err) print >>sys.stderr, "warning: failed to dump symbols for '%s': %s" % (filename, err)
missing_modules = [m for (m,_) in
itertools.ifilter(lambda (k,v): not v, found_required.iteritems())
]
if missing_modules:
raise MissingModuleError(missing_modules)
out.close() out.close()
return 0 return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment