base.bbclass: Add read_subpkgdata_dict function

git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5389 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
Richard Purdie
2008-10-02 19:56:43 +00:00
parent 5bcae485f5
commit 6e62524f37

View File

@@ -936,6 +936,19 @@ python read_subpackage_metadata () {
bb.data.setVar(key, sdata[key], d)
}
#
# Collapse FOO_pkg variables into FOO
#
def read_subpkgdata_dict(pkg, d):
import bb
ret = {}
subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
for var in subd:
newvar = var.replace("_" + pkg, "")
ret[newvar] = subd[var]
return ret
# Make sure MACHINE isn't exported
# (breaks binutils at least)
MACHINE[unexport] = "1"