mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +02:00
cmds.projects.BaseCmdPkgRelations: Support --quote
In a push to eventually merge class CmdRequiredOsPkg into this class, add the --quote option required by it. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
d643956846
commit
f075d3d0cf
1 changed files with 7 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ class BaseCmdPkgRelations(Cmd):
|
|||
recursive: bool=False,
|
||||
dont_expand_version_macros: bool=False,
|
||||
ignore: set[str] = set(),
|
||||
quote: bool = False,
|
||||
) -> list[str]:
|
||||
|
||||
if subsections is None:
|
||||
|
|
@ -126,8 +127,10 @@ class BaseCmdPkgRelations(Cmd):
|
|||
case '_':
|
||||
raise NotImplementedError(f'Unknown dependency syntax "{syntax}" for dependency "{dep[0]} {dep[1]} {dep[3]}"')
|
||||
dep_str = ' '.join(expanded_dep)
|
||||
if quote:
|
||||
dep_str = '"' + dep_str + '"'
|
||||
if not dep_str in r:
|
||||
log(DEBUG, f'Appending dependency "{dep_str}"')
|
||||
log(DEBUG, f'Appending dependency >{dep_str}<')
|
||||
r.append(dep_str)
|
||||
return r
|
||||
|
||||
|
|
@ -146,6 +149,7 @@ class BaseCmdPkgRelations(Cmd):
|
|||
recursive = args.recursive,
|
||||
dont_expand_version_macros = args.dont_expand_version_macros,
|
||||
ignore = set(args.ignore.split(',')),
|
||||
quote = args.quote,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -176,6 +180,8 @@ class BaseCmdPkgRelations(Cmd):
|
|||
default=False, help='Don\'t expand VERSION and REVISION macros')
|
||||
parser.add_argument('--ignore', nargs='?', default='', help='Packages that '
|
||||
'should be ignored together with their dependencies')
|
||||
parser.add_argument('--quote', action='store_true', default=False,
|
||||
help='Put double quotes around each listed dependency')
|
||||
|
||||
async def _run(self, args: Namespace) -> None:
|
||||
return self.print_pkg_relations(self.relation, args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue