[yocto] [PATCH 01/13] yocto-bsp: add new strip_base() function
    tom.zanussi at intel.com 
    tom.zanussi at intel.com
       
    Wed Aug  8 13:21:32 PDT 2012
    
    
  
From: Tom Zanussi <tom.zanussi at intel.com>
Add a strip_base() function to remove '/base' from the branch names
presented to the user.
Signed-off-by: Tom Zanussi <tom.zanussi at intel.com>
---
 scripts/lib/bsp/engine.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
index 8e53f00..cda1d14 100644
--- a/scripts/lib/bsp/engine.py
+++ b/scripts/lib/bsp/engine.py
@@ -449,6 +449,16 @@ def boolean(input_str, name):
         return name
 
 
+def strip_base(input_str):
+    """
+    strip '/base' off the end of input_str, so we can use 'base' in
+    the branch names we present to the user.
+    """
+    if input_str and input_str.endswith("/base"):
+        return input_str[:-len("/base")]
+    return input_str.strip()
+
+
 deferred_choices = {}
 
 def gen_choices_defer(input_line, context, checklist = False):
-- 
1.7.4.1
    
    
More information about the yocto
mailing list