summaryrefslogtreecommitdiffstats
path: root/rtems-bsps
diff options
context:
space:
mode:
authorRyan Long <ryan.long@oarcorp.com>2020-09-28 17:49:57 -0500
committerChris Johns <chrisj@rtems.org>2020-09-29 15:10:52 +1000
commit0805930d0c1ee11fc74c6028d93a3aaff1973e02 (patch)
treeb21dba954142786444bbd4fba43cf2228a3af47f /rtems-bsps
parentffc928b9a2a5e36e1aeb2872c3bef251e3b154da (diff)
downloadrtems-0805930d0c1ee11fc74c6028d93a3aaff1973e02.tar.bz2
rtems-bsps: add ability to print architecture/bsp list
Closes #4099.
Diffstat (limited to '')
-rwxr-xr-xrtems-bsps43
1 files changed, 40 insertions, 3 deletions
diff --git a/rtems-bsps b/rtems-bsps
index 05bf396e57..574ba1aad4 100755
--- a/rtems-bsps
+++ b/rtems-bsps
@@ -261,6 +261,34 @@ class ArchBsps:
(max_bsp, bsp, max_fb, family, p))
else:
self._out('%-*s |%s' % (max_bsp, bsp, family))
+
+ def pairs(self, arch_selector=None, family_selector=None, show_path=False):
+ """Generate output as pairs"""
+ self._clear()
+ max_arch = self._max_arch_len()
+ max_bsp = self._max_bsp_len()
+ if arch_selector is None:
+ arch_matcher = []
+ else:
+ arch_matcher = [a.strip() for a in arch_selector.split(',')]
+ if family_selector is None:
+ family_matcher = []
+ else:
+ family_matcher = [f.strip() for f in family_selector.split(',')]
+ for arch in sorted(self.archs.keys()):
+ if arch_selector is None or arch in arch_matcher:
+ for family in sorted(self.archs[arch].keys()):
+ if family_selector is None or family in family_matcher:
+ for bsp in sorted(self.archs[arch][family].keys()):
+ if show_path:
+ p = os.path.join('bsps',
+ self.archs[arch][family][bsp])
+ pair = arch + '/' + bsp
+ pair = '%-*s %s' % (max_arch + max_bsp + 1, pair, p)
+
+ self._out(pair)
+ else:
+ self._out('%s/%s' % (arch, bsp))
def run(args):
@@ -294,6 +322,10 @@ def run(args):
'--trace',
help='Verbose or trace for debugging',
action='store_true')
+ argsp.add_argument('-P',
+ '--pairs',
+ help='Output architectures and BSPs in CPU/BSP format',
+ action='store_true')
argopts = argsp.parse_args(args[1:])
@@ -309,9 +341,14 @@ def run(args):
show_path=argopts.paths,
show_title=argopts.title)
else:
- ab.text(arch_selector=argopts.arch,
- family_selector=argopts.family,
- show_path=argopts.paths)
+ if argopts.pairs:
+ ab.pairs(arch_selector=argopts.arch,
+ family_selector=argopts.family,
+ show_path=argopts.paths)
+ else:
+ ab.text(arch_selector=argopts.arch,
+ family_selector=argopts.family,
+ show_path=argopts.paths)
print(os.linesep.join(ab.output()))