]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/utils.py: add pre/post process helper function
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Wed, 18 Dec 2013 15:13:08 +0000 (17:13 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Feb 2014 11:50:24 +0000 (11:50 +0000)
This helper function will be used to execute pre/post process commands.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
meta/lib/oe/utils.py

index 36f82dbbecdb92fca29bb130e8a508d56f6f1b30..defa53679be3fa7c148215aae1844da9d3d58c16 100644 (file)
@@ -61,7 +61,7 @@ def both_contain(variable1, variable2, checkvalue, d):
         return ""
 
 def prune_suffix(var, suffixes, d):
-    # See if var ends with any of the suffixes listed and 
+    # See if var ends with any of the suffixes listed and
     # remove it if found
     for suffix in suffixes:
         if var.endswith(suffix):
@@ -154,3 +154,13 @@ def trim_version(version, num_parts=2):
 def cpu_count():
     import multiprocessing
     return multiprocessing.cpu_count()
+
+def execute_pre_post_process(d, cmds):
+    if cmds is None:
+        return
+
+    for cmd in cmds.strip().split(';'):
+        cmd = cmd.strip()
+        if cmd != '':
+            bb.note("Executing %s ..." % cmd)
+            bb.build.exec_func(cmd, d)