native.bbclass: Improve DEPENDS mangling code so sub matches don't break upon substitutions

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie
2009-11-05 20:05:45 +00:00
parent abe3902c2c
commit b26b8f4f23

View File

@@ -91,6 +91,9 @@ python __anonymous () {
pn = bb.data.getVar("PN", d, True)
depends = bb.data.getVar("DEPENDS", d, True)
deps = bb.utils.explode_deps(depends)
depends = bb.data.getVar("DEPENDS", d, True)
deps = bb.utils.explode_deps(depends)
newdeps = []
if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
autoextend = True
else:
@@ -98,16 +101,19 @@ python __anonymous () {
for dep in deps:
if dep.endswith("-cross"):
if autoextend:
depends = depends.replace(dep, dep.replace("-cross", "-native"))
newdeps.append(dep.replace("-cross", "-native"))
else:
bb.note("%s has depends %s which ends in -cross?" % (pn, dep))
if not dep.endswith("-native"):
newdeps.append(dep)
elif not dep.endswith("-native"):
if autoextend:
depends = depends.replace(dep, dep + "-native")
newdeps.append(dep + "-native")
else:
bb.note("%s has depends %s which doesn't end in -native?" % (pn, dep))
bb.data.setVar("DEPENDS", depends, d)
newdeps.append(dep)
else:
newdeps.append(dep)
bb.data.setVar("DEPENDS", " ".join(newdeps), d)
provides = bb.data.getVar("PROVIDES", d, True)
for prov in provides.split():
if prov.find(pn) != -1: