summaryrefslogtreecommitdiffstats
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
parent46731daa5f74a61dc6c48d9109b4ad4efb835705 (diff)
downloadopenembedded-core-contrib-7e380d460c25ba5cb6c9e75e39e7cd1b8719f412.tar.gz
openembedded-core-contrib-7e380d460c25ba5cb6c9e75e39e7cd1b8719f412.tar.bz2
openembedded-core-contrib-7e380d460c25ba5cb6c9e75e39e7cd1b8719f412.zip
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>
-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:
invalidate_task(fn, st, True)
# Create and print to the logs a virtual/xxxx -> PN (fn) table
- virtmap = taskData.get_providermap()
+ virtmap = taskData.get_providermap(prefix="virtual/")
virtpnmap = {}
for v in virtmap:
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:
break
# self.dump_data()
- def get_providermap(self):
- virts = []
- virtmap = {}
-
+ def get_providermap(self, prefix=None):
+ provmap = {}
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
+ if prefix and not name.startswith(prefix):
+ continue
+ if self.have_build_target(name):
+ provmap[name] = self.fn_index[self.get_provider(name)[0]]
+ return provmap
def dump_data(self):
"""