diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-11-19 08:05:46 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-01 21:07:19 +0000 |
commit | 2d97d82fb51281fe130e8d135f3cf9a78423dd94 (patch) | |
tree | 05cf51b8a06da6a9c24a30d7703794651ca85b41 | |
parent | b49c6f179b06a8b97106aa4c95f2cdb3c4dc0920 (diff) | |
download | openembedded-core-2d97d82fb51281fe130e8d135f3cf9a78423dd94.tar.gz openembedded-core-2d97d82fb51281fe130e8d135f3cf9a78423dd94.tar.bz2 openembedded-core-2d97d82fb51281fe130e8d135f3cf9a78423dd94.zip |
license.bbclass: Write recipeinfo file in license folder
Currently there is no way to get the recipe version when
creating the rootfs. It is needed because the manifest
file for the image has to contain this important piece
of information.
This change writes a new file in the license folder for
every recipe. This file is called "recipeinfo" and have
the information used to write the manifest file for the
recipes deployed next to the image.
[YOCTO #6772]
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
-rw-r--r-- | meta/classes/license.bbclass | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 8ad4614d61..17ae82d2c5 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -142,6 +142,10 @@ python do_populate_lic() { # The base directory we wrangle licenses to destdir = os.path.join(d.getVar('LICSSTATEDIR', True), d.getVar('PN', True)) copy_license_files(lic_files_paths, destdir) + info = get_recipe_info(d) + with open(os.path.join(destdir, "recipeinfo"), "w") as f: + for key in sorted(info.keys()): + f.write("%s: %s\n" % (key, info[key])) } # it would be better to copy them in do_install_append, but find_license_filesa is python @@ -156,6 +160,13 @@ python perform_packagecopy_prepend () { add_package_and_files(d) } +def get_recipe_info(d): + info = {} + info["PV"] = d.getVar("PV", True) + info["PR"] = d.getVar("PR", True) + info["LICENSE"] = d.getVar("LICENSE", True) + return info + def add_package_and_files(d): packages = d.getVar('PACKAGES', True) files = d.getVar('LICENSE_FILES_DIRECTORY', True) |