diff options
author | Mario Domenech Goulart <mario@ossystems.com.br> | 2015-05-12 11:03:40 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-28 09:44:08 +0100 |
commit | d3f66566834b10971e6e3d2a0d50290441b96c59 (patch) | |
tree | fd58ee98f5c5e60ec7dc8a1935399e0f416fabed | |
parent | cdc2c8aeaa96b07dfc431a4cf0bf51ef7f8802a3 (diff) | |
download | poky-d3f66566834b10971e6e3d2a0d50290441b96c59.tar.gz |
native.bbclass: avoid unintended substring replacement when setting PROVIDES
The way native_virtclass_handler was implemented leaded to
unintended substring replacements when setting PROVIDES for
native providers, in case the original PROVIDES value contains
providees with common substrings.
Here's a practical case where the old behavior was problematic:
the oracle-jse-jdk-x86-64 recipe provides both virtual/java and
virtual/javac:
Before:
$ bitbake -e oracle-jse-jdk-x86-64-native | grep ^PROVIDES=
PROVIDES="oracle-jse-jdk-x86-64-native virtual/java-native virtual/java-nativec"
After:
$ bitbake -e oracle-jse-jdk-x86-64-native | grep ^PROVIDES=
PROVIDES="oracle-jse-jdk-x86-64-native virtual/java-native virtual/javac-native"
Change-Id: I8186992dae58e37c2a2364586360ff9b7da9198f
(From OE-Core rev: c28291f1fb07fbc80275d9bceefed642c963e204)
(From OE-Core rev: e0814f2306e1404fffafc7695862c6ee542b08fa)
Signed-off-by: Mario Domenech Goulart <mario@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/native.bbclass | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass index 5ca5c95b4d..1f8139bec8 100644 --- a/meta/classes/native.bbclass +++ b/meta/classes/native.bbclass | |||
@@ -151,12 +151,13 @@ python native_virtclass_handler () { | |||
151 | map_dependencies("RREPLACES", e.data, pkg) | 151 | map_dependencies("RREPLACES", e.data, pkg) |
152 | 152 | ||
153 | provides = e.data.getVar("PROVIDES", True) | 153 | provides = e.data.getVar("PROVIDES", True) |
154 | nprovides = [] | ||
154 | for prov in provides.split(): | 155 | for prov in provides.split(): |
155 | if prov.find(pn) != -1: | 156 | if prov.find(pn) != -1: |
156 | continue | 157 | continue |
157 | if not prov.endswith("-native"): | 158 | if not prov.endswith("-native"): |
158 | provides = provides.replace(prov, prov + "-native") | 159 | nprovides.append(prov.replace(prov, prov + "-native")) |
159 | e.data.setVar("PROVIDES", provides) | 160 | e.data.setVar("PROVIDES", ' '.join(nprovides)) |
160 | 161 | ||
161 | e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native") | 162 | e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native") |
162 | } | 163 | } |