diff options
author | Timo Teräs <timo.teras@iki.fi> | 2023-11-15 16:44:23 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2023-11-15 16:46:07 +0200 |
commit | 7491ce405ab6db97d8decc09344c984997e8e514 (patch) | |
tree | bd194685bf6961c11213e47efad1b215fe4d1034 /src | |
parent | f08f8d4c57b814309a03b434e524f8b83c0697ee (diff) | |
download | apk-tools-7491ce405ab6db97d8decc09344c984997e8e514.tar.gz apk-tools-7491ce405ab6db97d8decc09344c984997e8e514.tar.bz2 apk-tools-7491ce405ab6db97d8decc09344c984997e8e514.tar.xz apk-tools-7491ce405ab6db97d8decc09344c984997e8e514.zip |
fetch: prefer fetching package with the concrete name2.14-stable
Instead of a package just providing the name
Diffstat (limited to 'src')
-rw-r--r-- | src/app_fetch.c | 7 |
1 files 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); |