瀏覽代碼

bitbake: taskdata: Add a function to return the virtual/ mapping data

When building an execution task graph, bitbake does resolve virtual/xxx
namespaces into specific providers. This data isn't exported anywhere
however.

This adds a function so that runqueue can at least retrieve this data
which can then be used by the system.

(Bitbake rev: ce51a51482d0900060512b24503714a730d72266)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 9 年之前
父節點
當前提交
0b96e6f1b5
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      bitbake/lib/bb/taskdata.py

+ 12 - 0
bitbake/lib/bb/taskdata.py

@@ -612,6 +612,18 @@ class TaskData:
                 break
         # self.dump_data()
 
+    def get_providermap(self):
+        virts = []
+        virtmap = {}
+
+        for name in self.build_names_index:
+            if name.startswith("virtual/"):
+                virts.append(name)
+        for v in virts:
+            if self.have_build_target(v):
+                virtmap[v] = self.fn_index[self.get_provider(v)[0]]
+        return virtmap
+
     def dump_data(self):
         """
         Dump some debug information on the internal data structures