From 7491ce405ab6db97d8decc09344c984997e8e514 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Wed, 15 Nov 2023 16:44:23 +0200 Subject: fetch: prefer fetching package with the concrete name Instead of a package just providing the name --- src/app_fetch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app_fetch.c b/src/app_fetch.c index 58afff4..fa2f7fa 100644 --- a/src/app_fetch.c +++ b/src/app_fetch.c @@ -301,9 +301,12 @@ static int mark_name(struct apk_database *db, const char *match, struct apk_name if (!name) goto err; - foreach_array_item(p, name->providers) - if (pkg == NULL || apk_pkg_version_compare(p->pkg, pkg) == APK_VERSION_GREATER) + foreach_array_item(p, name->providers) { + if (pkg == NULL || + (p->pkg->name == name && pkg->name != name) || + apk_pkg_version_compare(p->pkg, pkg) == APK_VERSION_GREATER) pkg = p->pkg; + } if (!pkg) goto err; mark_package(ctx, pkg); -- cgit v1.2.3-60-g2f50