Patchwork [2/4] terminal.bbclass: Fix BB_RUNFMT processing

login
register
mail settings
Submitter Mark Hatle
Date July 15, 2013, 8:10 p.m.
Message ID <1373919029-19108-3-git-send-email-mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/53711/
State Accepted
Commit 95f6e9a3d8fa24acc3bab392719e2d92be25d806
Headers show

Comments

Mark Hatle - July 15, 2013, 8:10 p.m.
BB_RUNFMT can include task and taskfunc, as well as func and pid.  Add the
two missing items toe the runfmt processing.

Also BB_RUNFMT can include arbitrary directory structure.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/terminal.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index ae338e9..591b4ac 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -18,8 +18,10 @@  def emit_terminal_func(command, envdata, d):
     envdata.setVarFlag(cmd_func, 'func', 1)
 
     runfmt = d.getVar('BB_RUNFMT', True) or "run.{func}.{pid}"
-    runfile = runfmt.format(func=cmd_func, pid=os.getpid())
+    runfile = runfmt.format(func=cmd_func, task=cmd_func, taskfunc=cmd_func, pid=os.getpid())
     runfile = os.path.join(d.getVar('T', True), runfile)
+    bb.mkdirhier(os.path.dirname(runfile))
+
     with open(runfile, 'w') as script:
         script.write('#!/bin/sh -e\n')
         bb.data.emit_func(cmd_func, script, envdata)