From 7b73fde75f42a7149abe515fc18dd5c9b2da5e1a Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 13 Mar 2024 11:06:37 +0100 Subject: [PATCH] [what]dependson: add --multibuild-package --- osc/commandline.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 8db51fc2..e73e93b3 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6543,6 +6543,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. # FIXME: the new osc syntax should allow to specify multiple packages # FIXME: the command should optionally use buildinfo data to show all dependencies + @cmdln.option('-M', '--multibuild-package', metavar='FLAVOR', + help=HELP_MULTIBUILD_ONE) def do_dependson(self, subcmd, opts, *args): """ Dependson shows the build dependencies inside of a project, valid for a given repository and architecture @@ -6563,10 +6565,12 @@ Please submit there instead, or use --nodevelproject to force direct submission. osc dependson REPOSITORY ARCH usage: - osc dependson PROJECT [PACKAGE] REPOSITORY ARCH + osc dependson PROJECT [PACKAGE[:FLAVOR]] REPOSITORY ARCH """ - self._dependson(False, *args) + self._dependson(False, opts, *args) + @cmdln.option('-M', '--multibuild-package', metavar='FLAVOR', + help=HELP_MULTIBUILD_ONE) def do_whatdependson(self, subcmd, opts, *args): """ Show the packages that require the specified package during the build @@ -6585,11 +6589,11 @@ Please submit there instead, or use --nodevelproject to force direct submission. osc whatdependson REPOSITORY ARCH usage: - osc whatdependson PROJECT [PACKAGE] REPOSITORY ARCH + osc whatdependson PROJECT [PACKAGE[:FLAVOR]] REPOSITORY ARCH """ - self._dependson(True, *args) + self._dependson(True, opts, *args) - def _dependson(self, reverse, *args): + def _dependson(self, reverse, opts, *args): wd = Path.cwd() args = slash_split(args) project = packages = repository = arch = None @@ -6622,6 +6626,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. repository = args[2] arch = args[3] + if packages is not None and opts.multibuild_package: + packages = [packages[0] + ":" + opts.multibuild_package] + project_packages = meta_get_packagelist(apiurl, project, deleted=False, expand=False) xml = get_dependson(apiurl, project, repository, arch, packages, reverse)