diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-03 12:33:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-03 12:33:18 +0000 |
commit | 9b2fd4b0fe103f1a626e079ade20bbc19d21ebf3 (patch) | |
tree | 842b60448d470026ec9ec79d393a9f2cc1cd6916 /meta/classes | |
parent | 1a559cbcca083d835447ad99ce85c683e49272f6 (diff) | |
download | openembedded-core-9b2fd4b0fe103f1a626e079ade20bbc19d21ebf3.tar.gz openembedded-core-9b2fd4b0fe103f1a626e079ade20bbc19d21ebf3.tar.bz2 openembedded-core-9b2fd4b0fe103f1a626e079ade20bbc19d21ebf3.zip |
license.bbclass: Add coverage by sstate code (also use cleandirs and dirs task attribures for directory handling)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/license.bbclass | 29 | ||||
-rw-r--r-- | meta/classes/sstate.bbclass | 1 |
2 files changed, 17 insertions, 13 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index b5021f2b58..97d4e4e41e 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -9,8 +9,11 @@ # differences and that should be corrected. LICENSE_DIRECTORY ??= "${DEPLOY_DIR_IMAGE}/licenses" +LICSSTATEDIR = "${WORKDIR}/license-destdir/" addtask populate_lic after do_patch before do_package +do_populate_lic[dirs] = "${LICSSTATEDIR}/${PN}" +do_populate_lic[cleandirs] = "${LICSSTATEDIR}" python do_populate_lic() { """ Populate LICENSE_DIRECTORY with licenses. @@ -25,7 +28,7 @@ python do_populate_lic() { lic_files = bb.data.getVar('LIC_FILES_CHKSUM', d, True) pn = bb.data.getVar('PN', d, True) # The base directory we wrangle licenses to - destdir = os.path.join(bb.data.getVar('LICENSE_DIRECTORY', d, True), pn) + destdir = os.path.join(bb.data.getVar('LICSSTATEDIR', d, True), pn) # The license files are located in S/LIC_FILE_CHECKSUM. srcdir = bb.data.getVar('S', d, True) # Directory we store the generic licenses as set in poky.conf @@ -33,18 +36,6 @@ python do_populate_lic() { if not generic_directory: raise bb.build.FuncFailed("COMMON_LICENSE_DIR is unset. Please set this in your distro config") - try: - # Let's try to clean up the packages license directory - shutil.rmtree(destdir) - except: - pass - - try: - # Create the package license directory structure. - bb.mkdirhier(destdir) - except: - pass - if not lic_files: # No recipe should have an invalid license file. This is checked else # where, but let's be pedantic @@ -98,3 +89,15 @@ python do_populate_lic() { bb.warn("This could be either because we do not have a generic for this license or the LICENSE field is incorrect") pass } + +SSTATETASKS += "do_populate_lic" +do_populate_lic[sstate-name] = "populate-lic" +do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}" +do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/" + +python do_populate_lic_setscene () { + sstate_setscene(d) +} +addtask do_populate_lic_setscene + + diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 4435abc347..a754821c08 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -415,6 +415,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): # This needs to go away, FIXME mapping = { "do_populate_sysroot" : "populate-sysroot", + "do_populate_lic" : "populate-lic", "do_package_write_ipk" : "deploy-ipk", "do_package_write_deb" : "deploy-deb", "do_package_write_rpm" : "deploy-rpm", |