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-21 11:35:21 +0100 |
| commit | b123553c1ac495009f11767a3d10a98625410e85 (patch) | |
| tree | 9a1689b1f77feaa33f3bc9e2848dcdb82fe8a4e6 /scripts/lib | |
| parent | 717704d12c60cf4d37f10c403ef4c463bc53fcd3 (diff) | |
| download | poky-b123553c1ac495009f11767a3d10a98625410e85.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().
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Diffstat (limited to 'scripts/lib')
| -rw-r--r-- | scripts/lib/bsp/engine.py | 7 | ||||
| -rw-r--r-- | scripts/lib/bsp/kernel.py | 18 |
2 files changed, 25 insertions, 0 deletions
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py index cda1d148e7..8b058093a8 100644 --- a/scripts/lib/bsp/engine.py +++ b/scripts/lib/bsp/engine.py | |||
| @@ -473,6 +473,11 @@ def gen_choices_defer(input_line, context, checklist = False): | |||
| 473 | except KeyError: | 473 | except KeyError: |
| 474 | nameappend = "" | 474 | nameappend = "" |
| 475 | 475 | ||
| 476 | try: | ||
| 477 | branches_base = input_line.props["branches_base"] | ||
| 478 | except KeyError: | ||
| 479 | branches_base = "" | ||
| 480 | |||
| 476 | filename = input_line.props["filename"] | 481 | filename = input_line.props["filename"] |
| 477 | 482 | ||
| 478 | closetag_start = filename.find(CLOSE_TAG) | 483 | closetag_start = filename.find(CLOSE_TAG) |
| @@ -488,6 +493,8 @@ def gen_choices_defer(input_line, context, checklist = False): | |||
| 488 | captured_context["filename"] = filename | 493 | captured_context["filename"] = filename |
| 489 | context["nameappend"] = nameappend | 494 | context["nameappend"] = nameappend |
| 490 | captured_context["nameappend"] = nameappend | 495 | captured_context["nameappend"] = nameappend |
| 496 | context["branches_base"] = branches_base | ||
| 497 | captured_context["branches_base"] = branches_base | ||
| 491 | 498 | ||
| 492 | deferred_choice = (input_line, captured_context, checklist) | 499 | deferred_choice = (input_line, captured_context, checklist) |
| 493 | key = name + "_" + filename + "_" + nameappend | 500 | key = name + "_" + filename + "_" + nameappend |
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index 8b3aa72c9c..e9bc2e87af 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py | |||
| @@ -711,6 +711,16 @@ def all_branches(context): | |||
| 711 | tmp = os.popen(gitcmd).read() | 711 | tmp = os.popen(gitcmd).read() |
| 712 | 712 | ||
| 713 | branches = [] | 713 | branches = [] |
| 714 | base_prefixes = None | ||
| 715 | |||
| 716 | try: | ||
| 717 | branches_base = context["branches_base"] | ||
| 718 | if branches_base: | ||
| 719 | base_prefixes = branches_base.split(":") | ||
| 720 | except KeyError: | ||
| 721 | pass | ||
| 722 | |||
| 723 | arch = context["arch"] | ||
| 714 | 724 | ||
| 715 | if tmp: | 725 | if tmp: |
| 716 | tmpline = tmp.split("\n") | 726 | tmpline = tmp.split("\n") |
| @@ -719,6 +729,14 @@ def all_branches(context): | |||
| 719 | break; | 729 | break; |
| 720 | idx = line.find("refs/heads/") | 730 | idx = line.find("refs/heads/") |
| 721 | kbranch = line[idx + len("refs/heads/"):] | 731 | kbranch = line[idx + len("refs/heads/"):] |
| 732 | kbranch_prefix = kbranch.rsplit("/", 1)[0] | ||
| 733 | |||
| 734 | if base_prefixes: | ||
| 735 | for base_prefix in base_prefixes: | ||
| 736 | if kbranch_prefix == base_prefix: | ||
| 737 | branches.append(kbranch) | ||
| 738 | continue | ||
| 739 | |||
| 722 | if (kbranch.find("/") != -1 and | 740 | if (kbranch.find("/") != -1 and |
| 723 | (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or | 741 | (kbranch.find("standard") != -1 or kbranch.find("base") != -1) or |
| 724 | kbranch == "base"): | 742 | kbranch == "base"): |
