Index: tools/check_ecs_deps/check_ecs_deps.py |
=================================================================== |
--- tools/check_ecs_deps/check_ecs_deps.py (revision 237842) |
+++ tools/check_ecs_deps/check_ecs_deps.py (working copy) |
@@ -70,6 +70,7 @@ |
'warn': lambda x: stdmsg('WARNING', x), |
'abend': lambda x: stdmsg('FAILED', x), |
'ok': lambda x: stdmsg('SUCCESS', x), |
+ 'verbose': lambda x: None, |
} |
parser = optparse.OptionParser( |
@@ -80,6 +81,7 @@ |
parser.add_option("-b", "--build-dir", |
help="the location of the compiler output") |
parser.add_option("--target", help="Debug or Release") |
+ parser.add_option('-v', '--verbose', default=False, action='store_true') |
options, args = parser.parse_args() |
Peter Mayo (wrong one)
2013/12/02 23:48:40
args is unused. Should Error on non options.
|
# Bake target into build_dir. |
@@ -95,19 +97,27 @@ |
target = binary_target |
if options.annotate: |
- output = { |
+ output.update({ |
'message': lambda x: bbmsg(None, x), |
'fail': lambda x: bbmsg('FAILURE', x), |
'warn': lambda x: bbmsg('WARNINGS', x), |
'abend': lambda x: bbmsg('EXCEPTIONS', x), |
'ok': lambda x: bbmsg(None, x), |
- } |
+ }) |
+ if options.verbose: |
+ output['verbose'] = lambda x: stdmsg(None, x) |
+ |
forbidden_regexp = re.compile(string.join(map(re.escape, |
kUndesiredLibraryList), '|')) |
- mapping_regexp = re.compile(r"\s*([^/]*) => ") |
+ mapping_regexp = re.compile(r"\s*([^/]*) => (.*)") |
blessed_regexp = re.compile(r"(%s)[-0-9.]*\.so" % string.join(map(re.escape, |
kAllowedLibraryList), '|')) |
+ if options.build_dir != None: |
+ built_regexp = re.compile(re.escape(options.build_dir)) |
+ else: |
+ built_regexp = re.compile(re.escape('lib')) |
+ built_regexp |
spang
2013/12/02 23:25:39
extra line?
Peter Mayo (wrong one)
2013/12/02 23:48:40
This line should be blank.
On 2013/12/02 23:25:39
|
success = 0 |
warning = 0 |
@@ -134,12 +144,17 @@ |
libmatch = mapping_regexp.match(d) |
if libmatch: |
lib = libmatch.group(1) |
+ source = libmatch.group(2) |
if forbidden_regexp.search(lib): |
success = 0 |
- output['message'](['Forbidden library: ' + lib]) |
- if not blessed_regexp.match(lib): |
+ output['message'](['Forbidden library: ' + lib]) |
+ elif built_regexp.match(source): |
+ output['verbose'](['Built library: ' + lib]) |
+ elif blessed_regexp.match(lib): |
+ output['verbose'](['Blessed library: ' + lib]) |
+ else: |
warning = 1 |
- output['message'](['Unexpected library: ' + lib]) |
+ output['message'](['Unexpected library: ' + lib]) |
if success == 1: |
if warning == 1: |