Skip to content
Snippets Groups Projects
Unverified Commit 61a9bdc8 authored by Oliver Smith's avatar Oliver Smith
Browse files

pmb.helpers.pmaports.get_repo: drop must_exist (MR 2405)

The function is never called with must_exist=False, so drop it.
parent b25fa5a8
No related branches found
No related tags found
No related merge requests found
......@@ -271,22 +271,15 @@ def find_providers(provide):
return sorted(providers.items(), reverse=True, key=lambda p: p[1].get("provider_priority", 0))
# FIXME (#2324): split into an _optional variant or drop must_exist
def get_repo(pkgname, must_exist=True) -> str | None:
def get_repo(pkgname) -> str | None:
"""Get the repository folder of an aport.
:pkgname: package name
:must_exist: raise an exception when it can't be found
:returns: a string like "main", "device", "cross", ...
or None when the aport could not be found
"""
aport: Path | None
if must_exist:
aport = find(pkgname)
else:
aport = find_optional(pkgname)
if not aport:
return None
aport: Path
aport = find(pkgname)
return aport.parent.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment