]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
yocto-bsp: add new strip_base() function
authorTom Zanussi <tom.zanussi@intel.com>
Tue, 19 Jun 2012 04:36:47 +0000 (23:36 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 2 Sep 2012 12:45:17 +0000 (05:45 -0700)
Add a strip_base() function to remove '/base' from the branch names
presented to the user.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
scripts/lib/bsp/engine.py

index 00ce863f03aca4fbc66c7c2939f519c83bf6362e..ac5058ca1ffb46fbef7755ad1557835d003d60ac 100644 (file)
@@ -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):