This step is currently only applicable to refkit. It allows us to
replace oe-core and oe-selftest layers in their bblayers.conf with
those layers that we are currently testing.

In the future, we may be able to improve this to replace layer "x"
with layer "y" dynamically, however that presents several challenges
outside the scope of this work.

[YOCTO #11745 ]

Signed-off-by: Stephano Cetola <[email protected]>
---
 .../autobuilder/buildsteps/ModBBLayersConf.py      | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 
lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py

diff --git 
a/lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py 
b/lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py
new file mode 100644
index 000000000..513e8a15a
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/ModBBLayersConf.py
@@ -0,0 +1,35 @@
+'''
+Created on July 24, 2017
+
+__author__ = "Stephano Cetola"
+__copyright__ = "Copyright 2017, Intel Corp."
+__credits__ = ["Stephano Cetola"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Stephano Cetola"
+__email__ = "[email protected]"
+'''
+
+from buildbot.steps.shell import ShellCommand
+from twisted.python import log
+
+class ModBBLayersConf(ShellCommand):
+    haltOnFailure = True
+    flunkOnFailure = True
+    name = "Modify BBLayers Configuration"
+    def __init__(self, factory, argdict=None, **kwargs):
+        self.factory = factory
+        for k, v in argdict.iteritems():
+            setattr(self, k, v)
+        self.description = "Modify BBLayers Configuration"
+        ShellCommand.__init__(self, **kwargs)
+
+    def start(self):
+        workdir = self.getProperty("workdir")
+        bblayers = "%s/build/build/conf/bblayers.conf" % workdir
+        yoctodir = "%s/build/meta \\\\" % workdir 
+        selftestdir = "%s/build/meta-selftest \\\\" % workdir
+        cmd1 = "sed -i 's|.*openembedded-core/meta .*|%s|' %s" % (yoctodir, 
bblayers)
+        cmd2 = "sed -i 's|.*openembedded-core/meta-selftest.*|%s|' %s" % 
(selftestdir, bblayers)
+        self.command = "%s;%s" % (cmd1, cmd2)
+        ShellCommand.start(self)
-- 
2.13.3

-- 
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to