pmb.helpers.pmaports: search apkbuild path only if package exists (!1896)

This commit is contained in:
Daniele Debernardi 2020-03-25 22:32:53 +01:00 committed by Oliver Smith
parent 0c179a5cf9
commit 20de238ff6
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -44,6 +44,7 @@ def guess_main_dev(args, subpkgname):
:returns: full path to the pmaport or None
"""
pkgname = subpkgname[:-4]
if pkgname in get_list(args):
paths = _glob_apkbuilds(args, pkgname)
if paths:
logging.debug(subpkgname + ": guessed to be a subpackage of " +
@ -86,6 +87,7 @@ def guess_main(args, subpkgname):
pkgname = "-".join(words)
# Look in pmaports
if pkgname in get_list(args):
paths = _glob_apkbuilds(args, pkgname)
if paths:
logging.debug(subpkgname + ": guessed to be a subpackage of " +
@ -112,6 +114,7 @@ def find(args, package, must_exist=True):
raise RuntimeError("Invalid pkgname: " + package)
# Search in packages
if package in get_list(args):
paths = _glob_apkbuilds(args, package)
if len(paths) > 1:
raise RuntimeError("Package " + package + " found in multiple"