Skip to content

Commit

Permalink
Merge pull request #1310 from dmach/dependson-identify-inherited-pack…
Browse files Browse the repository at this point in the history
…ages

Identify inherited packages in the 'dependson' command output
  • Loading branch information
dmach committed Apr 28, 2023
2 parents 0ea0015 + a08ab2e commit 426f210
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osc/commandline.py
Expand Up @@ -6475,6 +6475,8 @@ def do_whatdependson(self, subcmd, opts, *args):
This is no guarantee, since the new build might have changed dependencies.
The packages marked with the [i] flag are inherited to the project.
The arguments REPOSITORY and ARCH can be taken from the first two columns
of the 'osc repos' output.
Expand Down Expand Up @@ -6519,13 +6521,15 @@ def _dependson(self, reverse, *args):
repository = args[2]
arch = args[3]

project_packages = meta_get_packagelist(apiurl, project, deleted=False, expand=False)
xml = get_dependson(apiurl, project, repository, arch, packages, reverse)

root = ET.fromstring(xml)
for package in root.findall('package'):
print(package.get('name'), ":")
for dep in package.findall('pkgdep'):
print(" ", dep.text)
inherited = " " if dep.text in project_packages else "[i]"
print(f" {inherited} {dep.text}")

@cmdln.option('--alternative-project', metavar='PROJECT',
help='specify the build target project')
Expand Down

0 comments on commit 426f210

Please sign in to comment.