From ba463277ff342a8dc77d9a59c6e879e06a855298 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 18 Jun 2012 23:36:47 -0500 Subject: 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 Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- scripts/lib/bsp/engine.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts') diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py index 00ce863f03..ac5058ca1f 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): -- cgit v1.2.3-54-g00ecf