summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-11-12 14:14:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:07:19 +0000
commit2be96279580eac2b03970131dcd81b13c7f7f7d5 (patch)
tree706792cdad824ce887386e21f9da0e7cebfee094 /meta/classes
parentb165c2d3349115546c9db2f084eb6def4913b82d (diff)
downloadopenembedded-core-2be96279580eac2b03970131dcd81b13c7f7f7d5.tar.gz
openembedded-core-2be96279580eac2b03970131dcd81b13c7f7f7d5.tar.bz2
openembedded-core-2be96279580eac2b03970131dcd81b13c7f7f7d5.zip
license.bbclass: Added function get_deployed_dependencies
This change introduce a new function to get the dependencies that were deployed. It uses BB_TASKDEPDATAto get all the dependencies of the current task, so it is possible to get different packages depending at what point this function is called. [YOCTO #6772] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/license.bbclass48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index c05e6e0ecc..ff97098e2f 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -141,6 +141,54 @@ def write_license_files(d, license_manifest, pkg_dic):
os.link(pkg_license, pkg_rootfs_license)
+def get_deployed_dependencies(d):
+ """
+ Get all the deployed dependencies of an image
+ """
+
+ deploy = {}
+ # Get all the dependencies for the current task (rootfs).
+ # Also get EXTRA_IMAGEDEPENDS because the bootloader is
+ # usually in this var and not listed in rootfs.
+ # At last, get the dependencies from boot classes because
+ # it might contain the bootloader.
+ taskdata = d.getVar("BB_TASKDEPDATA", True)
+ depends = list(set([dep[0] for dep
+ in taskdata.itervalues()
+ if not dep[0].endswith("-native")]))
+ extra_depends = d.getVar("EXTRA_IMAGEDEPENDS", True)
+ boot_depends = get_boot_dependencies(d)
+ depends.extend(extra_depends.split())
+ depends.extend(boot_depends)
+ depends = list(set(depends))
+
+ # To verify what was deployed it checks the rootfs dependencies against
+ # the SSTATE_MANIFESTS for "deploy" task.
+ # The manifest file name contains the arch. Because we are not running
+ # in the recipe context it is necessary to check every arch used.
+ sstate_manifest_dir = d.getVar("SSTATE_MANIFESTS", True)
+ sstate_archs = d.getVar("SSTATE_ARCHS", True)
+ extra_archs = d.getVar("PACKAGE_EXTRA_ARCHS", True)
+ archs = list(set(("%s %s" % (sstate_archs, extra_archs)).split()))
+ for dep in depends:
+ # Some recipes have an arch on their own, so we try that first.
+ special_arch = d.getVar("PACKAGE_ARCH_pn-%s" % dep, True)
+ if special_arch:
+ sstate_manifest_file = os.path.join(sstate_manifest_dir,
+ "manifest-%s-%s.deploy" % (special_arch, dep))
+ if os.path.exists(sstate_manifest_file):
+ deploy[dep] = sstate_manifest_file
+ continue
+
+ for arch in archs:
+ sstate_manifest_file = os.path.join(sstate_manifest_dir,
+ "manifest-%s-%s.deploy" % (arch, dep))
+ if os.path.exists(sstate_manifest_file):
+ deploy[dep] = sstate_manifest_file
+ break
+
+ return deploy
+
def get_boot_dependencies(d):
"""
Return the dependencies from boot tasks