cmds.projects.BaseCmdPkgRelations: Add --hide-jw-pkg

Support --hide-jw-pkg. This is a step towards replacing
required-os-pkg, which leaves out packages from pkg.requires.jw
sections.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-06 13:57:20 +02:00
commit 40511947c9

View file

@ -33,6 +33,7 @@ class BaseCmdPkgRelations(Cmd):
quote: bool = False,
skip_excluded: bool = False,
hide_self = False,
hide_jw_pkg = False
) -> list[str]:
if subsections is None:
@ -81,6 +82,8 @@ class BaseCmdPkgRelations(Cmd):
if subsec == 'jw':
if recursive and not dep_name in visited and not dep_name in cur_pkgs:
cur_pkgs.append(dep_name)
if hide_jw_pkg:
continue
if len(dep) == 3:
if dont_expand_version_macros and dep_name in cur_pkgs:
version = dep[2]
@ -160,6 +163,7 @@ class BaseCmdPkgRelations(Cmd):
quote = args.quote,
skip_excluded = args.skip_excluded,
hide_self = args.hide_self,
hide_jw_pkg = args.hide_jw_pkg,
)
)
@ -194,6 +198,8 @@ class BaseCmdPkgRelations(Cmd):
help='Don\'t consider or output modules matching the os cascade in their [build].exclude config')
parser.add_argument('--hide-self', action='store_true', default=False,
help='Don\'t include any of the projects listed in <modules> in the output')
parser.add_argument('--hide-jw-pkg', action='store_true', default=False,
help='Don\'t include packages from requires.jw in the output')
parser.add_argument('--quote', action='store_true', default=False,
help='Put double quotes around each listed dependency')