[oe-commits] Mario Domenech Goulart : native.bbclass: avoid unintended substring replacement when setting PROVIDES

git at git.openembedded.org git at git.openembedded.org
Fri May 15 17:07:07 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 88508f1468f09ad19a85f5fc4013bd79613670c3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=88508f1468f09ad19a85f5fc4013bd79613670c3

Author: Mario Domenech Goulart <mario at ossystems.com.br>
Date:   Tue May 12 11:03:40 2015 -0300

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
Signed-off-by: Mario Domenech Goulart <mario at ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/classes/native.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index 5ca5c95..1f8139b 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -151,12 +151,13 @@ python native_virtclass_handler () {
         map_dependencies("RREPLACES", e.data, pkg)
 
     provides = e.data.getVar("PROVIDES", True)
+    nprovides = []
     for prov in provides.split():
         if prov.find(pn) != -1:
             continue
         if not prov.endswith("-native"):
-            provides = provides.replace(prov, prov + "-native")
-    e.data.setVar("PROVIDES", provides)
+            nprovides.append(prov.replace(prov, prov + "-native"))
+    e.data.setVar("PROVIDES", ' '.join(nprovides))
 
     e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
 }



More information about the Openembedded-commits mailing list