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

Torben Hohn torben.hohn at linutronix.de
Wed Dec 5 09:54:06 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 f08d36b5..9fc0a2eb 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 a7149c37..145d427a 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1877,6 +1877,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