summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-01-08 11:17:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-11 23:26:32 +0000
commit7e380d460c25ba5cb6c9e75e39e7cd1b8719f412 (patch)
tree7cf3c70ddcda61045dd41ead78f9f3a6c0844eaf /bitbake
parent46731daa5f74a61dc6c48d9109b4ad4efb835705 (diff)
downloadpoky-7e380d460c25ba5cb6c9e75e39e7cd1b8719f412.tar.gz
bitbake: taskdata: refactor get_providermap
Added optional parameter 'prefix' to filter out names that don't start with specified prefix. Changed existing call of get_providermap according to changed API. Optimized the code: got rid of extra loop and temporary list variable virts. (Bitbake rev: df5a1392d6f91ccb44a99721c7d847da242121bb) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py2
-rw-r--r--bitbake/lib/bb/taskdata.py17
2 files changed, 8 insertions, 11 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index da7059b17f..57b1cca525 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -808,7 +808,7 @@ class RunQueueData:
808 invalidate_task(fn, st, True) 808 invalidate_task(fn, st, True)
809 809
810 # Create and print to the logs a virtual/xxxx -> PN (fn) table 810 # Create and print to the logs a virtual/xxxx -> PN (fn) table
811 virtmap = taskData.get_providermap() 811 virtmap = taskData.get_providermap(prefix="virtual/")
812 virtpnmap = {} 812 virtpnmap = {}
813 for v in virtmap: 813 for v in virtmap:
814 virtpnmap[v] = self.dataCache.pkg_fn[virtmap[v]] 814 virtpnmap[v] = self.dataCache.pkg_fn[virtmap[v]]
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index 4d12b3325b..b08387067e 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -612,17 +612,14 @@ class TaskData:
612 break 612 break
613 # self.dump_data() 613 # self.dump_data()
614 614
615 def get_providermap(self): 615 def get_providermap(self, prefix=None):
616 virts = [] 616 provmap = {}
617 virtmap = {}
618
619 for name in self.build_names_index: 617 for name in self.build_names_index:
620 if name.startswith("virtual/"): 618 if prefix and not name.startswith(prefix):
621 virts.append(name) 619 continue
622 for v in virts: 620 if self.have_build_target(name):
623 if self.have_build_target(v): 621 provmap[name] = self.fn_index[self.get_provider(name)[0]]
624 virtmap[v] = self.fn_index[self.get_provider(v)[0]] 622 return provmap
625 return virtmap
626 623
627 def dump_data(self): 624 def dump_data(self):
628 """ 625 """