summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/providers.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-01-30 16:25:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-01 15:08:41 +0000
commit526264e7d74c8b5fad4ab5ec3303b2edfea98e61 (patch)
treee98177bfe5cb186d1ba9f2baa959263994f853f2 /bitbake/lib/bb/providers.py
parent3d2f6d56109fc3ebe9c8e7fe0d84d6cd01a9e2fb (diff)
downloadpoky-526264e7d74c8b5fad4ab5ec3303b2edfea98e61.tar.gz
bitbake-layers: improve show-overlayed output
Make the following improvements to the show-overlayed subcommand: * Show recipes that are overlayed when the version is higher or lower, not just when it is the same. This gives a much better picture of the influence each layer is having over the metadata used for building. This can be disabled with the -s option if you just want to see recipes with the same version as before. * Default to showing name (PN), layer and version rather than the full path and filename. The old style formatting can be used by specifying the -f option. * Mark skipped recipes as such in the output, and print them in the correct sorted place in the list rather than at the end * Prefix/suffix title line with === so it can be filtered out easily in shell scripts if desired (Bitbake rev: 43b473275d3cb2e60a14e4a52cdc4654b3f4e5e7) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/providers.py')
-rw-r--r--bitbake/lib/bb/providers.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/bitbake/lib/bb/providers.py b/bitbake/lib/bb/providers.py
index 398c8ea115..1dc6a8e8bf 100644
--- a/bitbake/lib/bb/providers.py
+++ b/bitbake/lib/bb/providers.py
@@ -24,6 +24,7 @@
24import re 24import re
25import logging 25import logging
26from bb import data, utils 26from bb import data, utils
27from collections import defaultdict
27import bb 28import bb
28 29
29logger = logging.getLogger("BitBake.Provider") 30logger = logging.getLogger("BitBake.Provider")
@@ -35,6 +36,41 @@ class NoRProvider(bb.BBHandledException):
35 """Exception raised when no provider of a runtime dependency can be found""" 36 """Exception raised when no provider of a runtime dependency can be found"""
36 37
37 38
39def findProviders(cfgData, dataCache, pkg_pn = None):
40 """
41 Convenience function to get latest and preferred providers in pkg_pn
42 """
43
44 if not pkg_pn:
45 pkg_pn = dataCache.pkg_pn
46
47 # Need to ensure data store is expanded
48 localdata = data.createCopy(cfgData)
49 bb.data.update_data(localdata)
50 bb.data.expandKeys(localdata)
51
52 preferred_versions = {}
53 latest_versions = {}
54
55 for pn in pkg_pn:
56 (last_ver, last_file, pref_ver, pref_file) = findBestProvider(pn, localdata, dataCache, pkg_pn)
57 preferred_versions[pn] = (pref_ver, pref_file)
58 latest_versions[pn] = (last_ver, last_file)
59
60 return (latest_versions, preferred_versions)
61
62
63def allProviders(dataCache):
64 """
65 Find all providers for each pn
66 """
67 all_providers = defaultdict(list)
68 for (fn, pn) in dataCache.pkg_fn.items():
69 ver = dataCache.pkg_pepvpr[fn]
70 all_providers[pn].append((ver, fn))
71 return all_providers
72
73
38def sortPriorities(pn, dataCache, pkg_pn = None): 74def sortPriorities(pn, dataCache, pkg_pn = None):
39 """ 75 """
40 Reorder pkg_pn by file priority and default preference 76 Reorder pkg_pn by file priority and default preference