yocto-bsp: add new strip_base() function

Add a strip_base() function to remove '/base' from the branch names
presented to the user.

(From meta-yocto rev: 216a38f6bb453e8e6617f82c3642151dbde2f377)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Tom Zanussi 2012-06-18 23:36:47 -05:00 committed by Richard Purdie
parent 7c5c1ad72b
commit ba463277ff
1 changed files with 10 additions and 0 deletions

View 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):