[rtems-central commit] specview.py: Add build filter

Sebastian Huber sebh at rtems.org
Tue Nov 21 13:35:40 UTC 2023


Module:    rtems-central
Branch:    master
Commit:    3998481598cdd4f942c26715bc50cbf4db0477a3
Changeset: http://git.rtems.org/rtems-central/commit/?id=3998481598cdd4f942c26715bc50cbf4db0477a3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Nov 21 11:13:15 2023 +0100

specview.py: Add build filter

---

 specview.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/specview.py b/specview.py
index 3b220bd1..a60abb97 100755
--- a/specview.py
+++ b/specview.py
@@ -30,6 +30,7 @@ import itertools
 import sys
 from typing import Any, Dict, List, Optional, Set, Tuple
 
+from rtemsspec.build import gather_files
 from rtemsspec.items import EmptyItem, Item, ItemCache, ItemMapper, \
     ItemGetValueContext
 from rtemsspec.rtems import augment_with_test_links, is_pre_qualified, \
@@ -372,7 +373,7 @@ def main() -> None:
     parser = argparse.ArgumentParser()
     parser.add_argument('--filter',
                         choices=[
-                            "none", "api", "orphan", "no-validation",
+                            "none", "api", "build", "orphan", "no-validation",
                             "action-table", "action-list", "design", "types"
                         ],
                         type=str.lower,
@@ -392,9 +393,12 @@ def main() -> None:
                         nargs="*",
                         help="an UID of a specification item")
     args = parser.parse_args(sys.argv[1:])
-    config = load_config("config.yml")["spec"]
-    config["enabled"] = args.enabled.split(",") if args.enabled else []
-    item_cache = ItemCache(config, is_item_enabled=recursive_is_enabled)
+    config = load_config("config.yml")
+    item_cache_config = config["spec"]
+    item_cache_config["enabled"] = args.enabled.split(
+        ",") if args.enabled else []
+    item_cache = ItemCache(item_cache_config,
+                           is_item_enabled=recursive_is_enabled)
     augment_with_test_links(item_cache)
     augment_with_test_case_links(item_cache)
     root = item_cache["/req/root"]
@@ -426,6 +430,9 @@ def main() -> None:
     elif args.filter == "types":
         for name in sorted(item_cache.items_by_type.keys()):
             print(name)
+    elif args.filter == "build":
+        for name in gather_files(config["build"], item_cache, False):
+            print(name)
 
 
 if __name__ == "__main__":



More information about the vc mailing list