Improve algorithm to pick package provider (!1775)

Pick the provider with the shortest name instead of always the first one
This commit is contained in:
Luca Weiss 2019-04-13 10:14:36 +02:00 committed by Oliver Smith
parent 8b8a73e8dd
commit c847dfde7c
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 19 additions and 11 deletions

View file

@ -89,11 +89,8 @@ def package_provider(args, pkgname, pkgnames_install, suffix="native"):
" the '" + suffix + "' chroot already")
return provider
# 5. Pick the first one
provider_pkgname = list(providers.keys())[0]
logging.debug(pkgname + " has multiple providers (" +
", ".join(providers) + "), picked: " + provider_pkgname)
return providers[provider_pkgname]
# 5. Pick the provider
return pmb.parse.apkindex.provider_shortest(providers, pkgname)
def package_from_index(args, pkgname_depend, pkgnames_install, package_aport,