1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

nativesdk: Don't use search and replace on DEPENDS field

Search and replace on the DEPENDS field can cause problems if
multiple similar names are present in the string so use an
alternative approach.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie
2009-09-17 00:16:46 +01:00
parent 0d7207ca39
commit bc5afa640b
+10 -6
View File
@@ -75,21 +75,25 @@ python __anonymous () {
pn = bb.data.getVar("PN", d, True) pn = bb.data.getVar("PN", d, True)
depends = bb.data.getVar("DEPENDS", d, True) depends = bb.data.getVar("DEPENDS", d, True)
deps = bb.utils.explode_deps(depends) deps = bb.utils.explode_deps(depends)
if "sdk" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""): newdeps = []
if "nativesdk" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
autoextend = True autoextend = True
else: else:
autoextend = False autoextend = False
for dep in deps: for dep in deps:
if dep.endswith("-native") or dep.endswith("-cross"): if dep.endswith("-native") or dep.endswith("-cross"):
continue newdeps.append(dep)
if not dep.endswith("-nativesdk"): elif not dep.endswith("-nativesdk"):
if autoextend: if autoextend:
depends = depends.replace(dep, dep + "-nativesdk") newdeps.append(dep + "-nativesdk")
elif pn == 'gcc-cross-nativesdk': elif pn == 'gcc-cross-nativesdk':
continue newdeps.append(dep)
else: else:
newdeps.append(dep)
bb.note("%s has depends %s which doesn't end in -nativesdk?" % (pn, dep)) bb.note("%s has depends %s which doesn't end in -nativesdk?" % (pn, dep))
bb.data.setVar("DEPENDS", depends, d) else:
newdeps.append(dep)
bb.data.setVar("DEPENDS", " ".join(newdeps), d)
provides = bb.data.getVar("PROVIDES", d, True) provides = bb.data.getVar("PROVIDES", d, True)
for prov in provides.split(): for prov in provides.split():
if prov.find(pn) != -1: if prov.find(pn) != -1: