1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-22 06:28:53 +02:00

Move showlinked code from commandline to _private

This commit is contained in:
2022-11-09 10:31:20 +01:00
parent 2f70408dea
commit 4634690176
6 changed files with 82 additions and 16 deletions

View File

@@ -66,3 +66,19 @@ def enable_channels(apiurl, project, package=None, print_to="debug"):
url_query = {"cmd": "modifychannels", "mode": "enable_all"}
return api.post(apiurl, url_path, url_query)
def get_linked_packages(apiurl, project, package):
url_path = ["source", project, package]
url_query = {"cmd": "showlinked"}
root = api.post(apiurl, url_path, url_query)
result = []
nodes = api.find_nodes(root, "collection", "package")
for node in nodes:
item = {
"project": node.get("project"),
"name": node.get("name"),
}
result.append(item)
return result