From 7be26836cac6142c46f9b258b7374e2cf54e1e37 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Sun, 5 Aug 2012 12:29:16 -0500 Subject: yocto-bsp: allow branch display filtering Add a "branches_base" property that can be used to allow only matching branches to be returned from all_branches(). (From meta-yocto rev: c3481e22fc4690ff5e449f9c16c2453fa964205d) Signed-off-by: Tom Zanussi Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- scripts/lib/bsp/kernel.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scripts/lib/bsp/kernel.py') diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index 7c6da4e2eb..d4bdc4c250 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py @@ -713,6 +713,17 @@ def all_branches(context): branches = [] + base_prefixes = None + + try: + branches_base = context["branches_base"] + if branches_base: + base_prefixes = branches_base.split(":") + except KeyError: + pass + + arch = context["arch"] + if tmp: tmpline = tmp.split("\n") for line in tmpline: @@ -720,6 +731,14 @@ def all_branches(context): break; idx = line.find("refs/heads/") kbranch = line[idx + len("refs/heads/"):] + kbranch_prefix = kbranch.rsplit("/", 1)[0] + + if base_prefixes: + for base_prefix in base_prefixes: + if kbranch_prefix == base_prefix: + branches.append(kbranch) + continue + if (kbranch.find("/") != -1 and (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or kbranch == "base"): -- cgit v1.2.3-54-g00ecf