From b26b8f4f23f638651886cd29e969cdefb591eb74 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 5 Nov 2009 20:05:45 +0000 Subject: native.bbclass: Improve DEPENDS mangling code so sub matches don't break upon substitutions Signed-off-by: Richard Purdie --- meta/classes/native.bbclass | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'meta/classes/native.bbclass') diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass index 6bd37697d..2bd0cf3df 100644 --- a/meta/classes/native.bbclass +++ b/meta/classes/native.bbclass @@ -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: -- cgit v1.2.3