From ba097bb5768ef4091dc8e06596662ee508adeb7f Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Mon, 12 Jun 2017 18:33:10 +0800 Subject: [PATCH] vndk-def: Fix check-dep errors on vendor_libs This commit fixes a check-dep bug introduced by 7e723126e4. In 7e723126e4, graph.lib_pt[PT_VENDOR].values() was changed to return an iterator instead of a set. This means we can only traverse the iterator once, thus vendor-to-vendor dependencies were treated as ineligible dependencies. This commit fixes the problem by creating a set() object from the iterator, so that `vendor_libs` can be used several times. This also makes it faster to lookup an object. Test: Run `vndk_definition_tool.py check-dep` against sailfish images and vendor-to-vendor dependencies should not show up. Change-Id: I3b36efa635220941278c491b83f308a65e9f0ffe --- vndk/tools/definition-tool/vndk_definition_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vndk/tools/definition-tool/vndk_definition_tool.py b/vndk/tools/definition-tool/vndk_definition_tool.py index 3830025f3..c1eddfa0d 100755 --- a/vndk/tools/definition-tool/vndk_definition_tool.py +++ b/vndk/tools/definition-tool/vndk_definition_tool.py @@ -2482,7 +2482,7 @@ class CheckDepCommand(ELFGraphCommand): """Check whether vendor libs are depending on non-eligible libs.""" num_errors = 0 - vendor_libs = graph.lib_pt[PT_VENDOR].values() + vendor_libs = set(graph.lib_pt[PT_VENDOR].values()) eligible_libs = (tagged_libs.ll_ndk | tagged_libs.sp_ndk | \ tagged_libs.vndk_sp | tagged_libs.vndk_sp_indirect | \