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:44:23 +0200 |
commit | ec2ca333301bd292dc956ca42957cee9376bf2ee (patch) | |
tree | d5ae82c45a837cd0416090418341d2b8d09d2f42 | |
parent | 3bf521ba06711394d6ac8a12e5e55b452a7e5107 (diff) | |
download | apk-tools-master.tar.gz apk-tools-master.tar.bz2 apk-tools-master.tar.xz apk-tools-master.zip |
fetch: prefer fetching package with the concrete namemaster
Instead of a package just providing the name
-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 03c4b2a..1e188c1 100644 --- a/src/app_fetch.c +++ b/src/app_fetch.c @@ -294,9 +294,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); |