summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
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:52:32 +0000
commitbe77f3138cc1c4131b74924b275acef692f46b26 (patch)
tree3d23138605064e2383f6919780375337a419eb41 /meta/classes/package.bbclass
parentc467a018ba364dc22fa2a3ba61c2c4e807e67c0a (diff)
downloadpoky-be77f3138cc1c4131b74924b275acef692f46b26.tar.gz
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'. (From OE-Core rev: 98ea2fc35a3ef609a944929e21e0f9be2889036d) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-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):
363 363
364 return pkg 364 return pkg
365 365
366def get_package_additional_metadata (pkg_type, d):
367 base_key = "PACKAGE_ADD_METADATA"
368 for key in ("%s_%s" % (base_key, pkg_type.upper()), base_key):
369 if d.getVar(key) is None:
370 continue
371 d.setVarFlag(key, "type", "list")
372 if d.getVarFlag(key, "separator") is None:
373 d.setVarFlag(key, "separator", "\\n")
374 metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
375 return "\n".join(metadata_fields).strip()
376
366def runtime_mapping_rename (varname, pkg, d): 377def runtime_mapping_rename (varname, pkg, d):
367 #bb.note("%s before: %s" % (varname, d.getVar(varname, True))) 378 #bb.note("%s before: %s" % (varname, d.getVar(varname, True)))
368 379