diff options
author | Tom Zanussi <tom.zanussi@intel.com> | 2012-08-05 12:29:16 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-25 14:47:02 +0100 |
commit | 7be26836cac6142c46f9b258b7374e2cf54e1e37 (patch) | |
tree | 645deb80d5643646461577ac60f1c35b5a5c56a7 /scripts/lib/bsp | |
parent | 0f34dd65f22ae0505f8f04faeaa5489d333496cd (diff) | |
download | poky-7be26836cac6142c46f9b258b7374e2cf54e1e37.tar.gz |
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 <tom.zanussi@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/bsp')
-rw-r--r-- | scripts/lib/bsp/engine.py | 7 | ||||
-rw-r--r-- | scripts/lib/bsp/kernel.py | 19 |
2 files changed, 26 insertions, 0 deletions
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py index 8e53f00bd2..bf6ebaad47 100644 --- a/scripts/lib/bsp/engine.py +++ b/scripts/lib/bsp/engine.py | |||
@@ -463,6 +463,11 @@ def gen_choices_defer(input_line, context, checklist = False): | |||
463 | except KeyError: | 463 | except KeyError: |
464 | nameappend = "" | 464 | nameappend = "" |
465 | 465 | ||
466 | try: | ||
467 | branches_base = input_line.props["branches_base"] | ||
468 | except KeyError: | ||
469 | branches_base = "" | ||
470 | |||
466 | filename = input_line.props["filename"] | 471 | filename = input_line.props["filename"] |
467 | 472 | ||
468 | closetag_start = filename.find(CLOSE_TAG) | 473 | closetag_start = filename.find(CLOSE_TAG) |
@@ -478,6 +483,8 @@ def gen_choices_defer(input_line, context, checklist = False): | |||
478 | captured_context["filename"] = filename | 483 | captured_context["filename"] = filename |
479 | context["nameappend"] = nameappend | 484 | context["nameappend"] = nameappend |
480 | captured_context["nameappend"] = nameappend | 485 | captured_context["nameappend"] = nameappend |
486 | context["branches_base"] = branches_base | ||
487 | captured_context["branches_base"] = branches_base | ||
481 | 488 | ||
482 | deferred_choice = (input_line, captured_context, checklist) | 489 | deferred_choice = (input_line, captured_context, checklist) |
483 | key = name + "_" + filename + "_" + nameappend | 490 | key = name + "_" + filename + "_" + nameappend |
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): | |||
713 | 713 | ||
714 | branches = [] | 714 | branches = [] |
715 | 715 | ||
716 | base_prefixes = None | ||
717 | |||
718 | try: | ||
719 | branches_base = context["branches_base"] | ||
720 | if branches_base: | ||
721 | base_prefixes = branches_base.split(":") | ||
722 | except KeyError: | ||
723 | pass | ||
724 | |||
725 | arch = context["arch"] | ||
726 | |||
716 | if tmp: | 727 | if tmp: |
717 | tmpline = tmp.split("\n") | 728 | tmpline = tmp.split("\n") |
718 | for line in tmpline: | 729 | for line in tmpline: |
@@ -720,6 +731,14 @@ def all_branches(context): | |||
720 | break; | 731 | break; |
721 | idx = line.find("refs/heads/") | 732 | idx = line.find("refs/heads/") |
722 | kbranch = line[idx + len("refs/heads/"):] | 733 | kbranch = line[idx + len("refs/heads/"):] |
734 | kbranch_prefix = kbranch.rsplit("/", 1)[0] | ||
735 | |||
736 | if base_prefixes: | ||
737 | for base_prefix in base_prefixes: | ||
738 | if kbranch_prefix == base_prefix: | ||
739 | branches.append(kbranch) | ||
740 | continue | ||
741 | |||
723 | if (kbranch.find("/") != -1 and | 742 | if (kbranch.find("/") != -1 and |
724 | (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or | 743 | (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or |
725 | kbranch == "base"): | 744 | kbranch == "base"): |