parse.depends: consider selected providers when resolving providers
If a package had _pmb_select set and an appropriate provider configured in pmb's cfg, it was not being used when providers were being resolved. With this change, those are now being considered. The order is also important, we want a selected provider to be chosen before it tries to make a decision based on provider_priority later in step #6. Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231122081214.11872-2-clayton@craftyguy.net%3E
This commit is contained in:
parent
c25425b97d
commit
d38589a121
|
@ -72,13 +72,20 @@ def package_provider(args, pkgname, pkgnames_install, suffix="native"):
|
|||
"chroot already")
|
||||
return provider
|
||||
|
||||
# 5. Pick the provider(s) with the highest priority
|
||||
# 5. Pick an explicitly selected provider
|
||||
provider_pkgname = args.selected_providers.get(pkgname, "")
|
||||
if provider_pkgname in providers:
|
||||
logging.verbose(f"{pkgname}: choosing provider '{provider_pkgname}', "
|
||||
"because it was explicitly selected.")
|
||||
return providers[provider_pkgname]
|
||||
|
||||
# 6. Pick the provider(s) with the highest priority
|
||||
providers = pmb.parse.apkindex.provider_highest_priority(
|
||||
providers, pkgname)
|
||||
if len(providers) == 1:
|
||||
return list(providers.values())[0]
|
||||
|
||||
# 6. Pick the shortest provider. (Note: Normally apk would fail here!)
|
||||
# 7. Pick the shortest provider. (Note: Normally apk would fail here!)
|
||||
return pmb.parse.apkindex.provider_shortest(providers, pkgname)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue