forked from Mirror/pmbootstrap
helpers: pmaports: Always fall back to parsing all APKBUILDS (MR 2476)
Previously, it would only fall back to parsing all APKBUILDs if a main package was guessed for this potential subpackage. We do however want to scan all APKBUILDs in case the package is provided by one of the packages in pmaports. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit is contained in:
parent
4b4ba1e6ec
commit
822e89ed13
1 changed files with 14 additions and 13 deletions
|
@ -222,20 +222,21 @@ def find(package, must_exist=True, subpackages=True, with_extra_repos="default")
|
||||||
# Parse the APKBUILD and verify if the guess was right
|
# Parse the APKBUILD and verify if the guess was right
|
||||||
if _find_package_in_apkbuild(package, guess / "APKBUILD"):
|
if _find_package_in_apkbuild(package, guess / "APKBUILD"):
|
||||||
ret = guess
|
ret = guess
|
||||||
else:
|
|
||||||
# Otherwise parse all APKBUILDs (takes time!), is the
|
|
||||||
# package we are looking for a subpackage of any of those?
|
|
||||||
for path_current in _find_apkbuilds().values():
|
|
||||||
if _find_package_in_apkbuild(package, path_current):
|
|
||||||
ret = path_current.parent
|
|
||||||
break
|
|
||||||
|
|
||||||
# If we still didn't find anything, as last resort: assume our
|
if not guess or (guess and not ret):
|
||||||
# initial guess was right and the APKBUILD parser just didn't
|
# Otherwise parse all APKBUILDs (takes time!), is the
|
||||||
# find the subpackage in there because it is behind shell logic
|
# package we are looking for a subpackage of any of those?
|
||||||
# that we don't parse.
|
for path_current in _find_apkbuilds().values():
|
||||||
if not ret:
|
if _find_package_in_apkbuild(package, path_current):
|
||||||
ret = guess
|
ret = path_current.parent
|
||||||
|
break
|
||||||
|
|
||||||
|
# If we still didn't find anything, as last resort: assume our
|
||||||
|
# initial guess was right and the APKBUILD parser just didn't
|
||||||
|
# find the subpackage in there because it is behind shell logic
|
||||||
|
# that we don't parse.
|
||||||
|
if not ret:
|
||||||
|
ret = guess
|
||||||
|
|
||||||
# Crash when necessary
|
# Crash when necessary
|
||||||
if ret is None and must_exist:
|
if ret is None and must_exist:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue