Add error messages for wrong library names

Test: ./create_reference_dumps.py -libs libc.so
Test: ./create_reference_dumps.py -libs abc
Bug: 148697867
Change-Id: I621eb01289ba142c85b19eea9be4ef99f32fcdbe
This commit is contained in:
Hsin-Yi Chen
2020-02-03 14:27:26 +08:00
parent cfeef5f41c
commit c396520b78
2 changed files with 12 additions and 0 deletions

View File

@@ -176,6 +176,8 @@ def make_libraries(product, variant, vndk_version, targets, libs):
build=True)
make_target_paths = []
for name in libs:
if not (name in lsdump_paths and lsdump_paths[name]):
raise KeyError('Cannot find lsdump for %s.' % name)
make_target_paths.extend(path for tag, path in
lsdump_paths[name].values())
make_targets(product, variant, make_target_paths)
@@ -281,6 +283,10 @@ def find_lib_lsdumps(lsdump_paths, libs, target):
result = []
if libs:
for lib_name in libs:
if not (lib_name in lsdump_paths and
arch_cpu in lsdump_paths[lib_name]):
raise KeyError('Cannot find lsdump for %s, %s.' %
(lib_name, arch_cpu))
result.append(lsdump_paths[lib_name][arch_cpu])
else:
result.extend(paths[arch_cpu] for paths in lsdump_paths.values())