aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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:02:37 +0000
commit43b473275d3cb2e60a14e4a52cdc4654b3f4e5e7 (patch)
tree236eb1ba68575652297bce4f748fd7d7a05cb6df /lib
parent35d2c1c618826e961dbf4b9889b829f469346d74 (diff)
downloadbitbake-43b473275d3cb2e60a14e4a52cdc4654b3f4e5e7.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 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/cooker.py14
-rw-r--r--lib/bb/providers.py36
2 files changed, 37 insertions, 13 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index ac99e914d..7dab38e28 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -259,20 +259,8 @@ class BBCooker:
# Need files parsed
self.updateCache()
- # Need to ensure data store is expanded
- localdata = data.createCopy(self.configuration.data)
- bb.data.update_data(localdata)
- bb.data.expandKeys(localdata)
-
pkg_pn = self.status.pkg_pn
- preferred_versions = {}
- latest_versions = {}
-
- # Sort by priority
- for pn in pkg_pn:
- (last_ver, last_file, pref_ver, pref_file) = bb.providers.findBestProvider(pn, localdata, self.status)
- preferred_versions[pn] = (pref_ver, pref_file)
- latest_versions[pn] = (last_ver, last_file)
+ (latest_versions, preferred_versions) = bb.providers.findProviders(self.configuration.data, self.status, pkg_pn)
logger.plain("%-35s %25s %25s", "Package Name", "Latest Version", "Preferred Version")
logger.plain("%-35s %25s %25s\n", "============", "==============", "=================")
diff --git a/lib/bb/providers.py b/lib/bb/providers.py
index 398c8ea11..1dc6a8e8b 100644
--- a/lib/bb/providers.py
+++ b/lib/bb/providers.py
@@ -24,6 +24,7 @@
import re
import logging
from bb import data, utils
+from collections import defaultdict
import bb
logger = logging.getLogger("BitBake.Provider")
@@ -35,6 +36,41 @@ class NoRProvider(bb.BBHandledException):
"""Exception raised when no provider of a runtime dependency can be found"""
+def findProviders(cfgData, dataCache, pkg_pn = None):
+ """
+ Convenience function to get latest and preferred providers in pkg_pn
+ """
+
+ if not pkg_pn:
+ pkg_pn = dataCache.pkg_pn
+
+ # Need to ensure data store is expanded
+ localdata = data.createCopy(cfgData)
+ bb.data.update_data(localdata)
+ bb.data.expandKeys(localdata)
+
+ preferred_versions = {}
+ latest_versions = {}
+
+ for pn in pkg_pn:
+ (last_ver, last_file, pref_ver, pref_file) = findBestProvider(pn, localdata, dataCache, pkg_pn)
+ preferred_versions[pn] = (pref_ver, pref_file)
+ latest_versions[pn] = (last_ver, last_file)
+
+ return (latest_versions, preferred_versions)
+
+
+def allProviders(dataCache):
+ """
+ Find all providers for each pn
+ """
+ all_providers = defaultdict(list)
+ for (fn, pn) in dataCache.pkg_fn.items():
+ ver = dataCache.pkg_pepvpr[fn]
+ all_providers[pn].append((ver, fn))
+ return all_providers
+
+
def sortPriorities(pn, dataCache, pkg_pn = None):
"""
Reorder pkg_pn by file priority and default preference