summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorLeonid Borisenko <ive.found@gmail.com>2012-11-16 18:29:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-28 00:48:24 +0000
commit98ea2fc35a3ef609a944929e21e0f9be2889036d (patch)
tree1f7bd76c965bd80ee8e1e67dc1c98737d82c32b6 /meta
parentb71670bfbd8e394521cfd969eeafad4adc34c285 (diff)
downloadopenembedded-core-98ea2fc35a3ef609a944929e21e0f9be2889036d.tar.gz
openembedded-core-98ea2fc35a3ef609a944929e21e0f9be2889036d.tar.bz2
openembedded-core-98ea2fc35a3ef609a944929e21e0f9be2889036d.zip
package.bbclass: add getter of additional metadata
Two variables are searched for value of additional package metadata: * PACKAGE_ADD_METADATA_<PKGTYPE> * PACKAGE_ADD_METADATA First found variable with defined value wins. <PKGTYPE> is a parameter of getter and expected to be a distinct name of specific package type. For example: 'DEB' or 'RPM'. Variable can contain multiple [one-line] metadata fields, separated by literal sequence '\n'. Separator can be redefined through variable flag 'separator'. Getter returns found value with separator replaced with newline character. As side-effect, searched variables acquired flags 'type' (equals to 'list') and 'separator'. Signed-off-by: Leonid Borisenko <ive.found@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 9b511a6bc9..70f9aaa205 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -363,6 +363,17 @@ def get_package_mapping (pkg, basepkg, d):
return pkg
+def get_package_additional_metadata (pkg_type, d):
+ base_key = "PACKAGE_ADD_METADATA"
+ for key in ("%s_%s" % (base_key, pkg_type.upper()), base_key):
+ if d.getVar(key) is None:
+ continue
+ d.setVarFlag(key, "type", "list")
+ if d.getVarFlag(key, "separator") is None:
+ d.setVarFlag(key, "separator", "\\n")
+ metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
+ return "\n".join(metadata_fields).strip()
+
def runtime_mapping_rename (varname, pkg, d):
#bb.note("%s before: %s" % (varname, d.getVar(varname, True)))