Show package and other improvements
Change-Id: I449a32a68be7d9c87c874c641b353866030297ae
Related-PROD: PROD-28199
diff --git a/cfg_checker/modules/packages/__init__.py b/cfg_checker/modules/packages/__init__.py
index f88ce51..77c1654 100644
--- a/cfg_checker/modules/packages/__init__.py
+++ b/cfg_checker/modules/packages/__init__.py
@@ -60,6 +60,16 @@
action="store_true", default=False,
help="Save pkg descriptions while parsing"
)
+ pkg_show = pkg_subparsers.add_parser(
+ 'show',
+ help="Show package history from the map"
+ )
+ pkg_show.add_argument(
+ 'args',
+ nargs='+',
+ help="Package names separated by space"
+ )
+
return _parser
@@ -89,6 +99,9 @@
"""
# Get the list of tags for the url
r = RepoManager()
+ if args.list_tags:
+ r.action_for_tag(args.url, args.tag, action="list")
+ return
if args.build_repos:
# if tag is supplied, use it
if args.tag:
@@ -96,7 +109,6 @@
else:
r.build_repos(args.url)
- # if tag is supplied, use it
if args.tag:
# Process only this tag
r.action_for_tag(
@@ -108,3 +120,13 @@
else:
# All of them
r.parse_repos()
+
+
+def do_show(args):
+ """Shows package (or multiple) history across parsed tags
+ """
+ # Init manager
+ r = RepoManager()
+ # show packages
+ for p in args.args:
+ r.show_package(p)