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

Unified Diff: tools/check_ecs_deps/check_ecs_deps.py

Issue 95903002: Enhance check_ecs_deps to allow locally built libraries. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698