[elbe-devel] [PATCH 2/9] finetuning: imeplement projcmd for project-finetuning

Torben Hohn torben.hohn at linutronix.de
Wed Nov 28 17:28:57 CET 2018


add projcmd to project-finetuning, that execute commands
in project directory using shell.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/finetuning.py | 18 ++++++++++++++++++
 schema/dbsfed.xsd      |  7 +++++++
 2 files changed, 25 insertions(+)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index e4f889a2..8ba903f0 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -472,6 +472,24 @@ class UpdatedAction(FinetuningAction):
 FinetuningAction.register(UpdatedAction)
 
 
+class ProjCmdAction(FinetuningAction):
+
+    tag = 'projcmd'
+
+    def __init__(self, node):
+        FinetuningAction.__init__(self, node)
+
+    def execute(self, _log, _buildenv, _target):
+        raise NotImplementedError("<projcmd> may only be "
+                                  "used in <project-finetuning>")
+
+    def execute_prj(self, log, _buildenv, _target, builddir):
+        log.do('cd "%s"; %s' % (builddir, self.node.et.text))
+
+
+FinetuningAction.register(ProjCmdAction)
+
+
 def do_finetuning(xml, log, buildenv, target):
 
     if not xml.has('target/finetuning'):
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index 85cbaff0..f0b244d8 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1858,6 +1858,13 @@
           </documentation>
         </annotation>
       </element>
+      <element name="projcmd" type="rfs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+	    cd into the project directory, and execute the command via /bin/sh
+          </documentation>
+        </annotation>
+      </element>
     </choice>
   </group>
 
-- 
2.11.0




More information about the elbe-devel mailing list