diff mbox series

opkg: prioritize the latest provider (not the first)

Message ID 20200716143444.77470-1-peter.stadler@student.uibk.ac.at
State New
Headers show
Series opkg: prioritize the latest provider (not the first) | expand

Commit Message

Peter Stadler July 16, 2020, 2:34 p.m. UTC

this is now the right patch that does:

Set `priorized_matching` to the latest provider with maximum priority, such
that it is similar to the other selections (especially `good_pkg_by_name`).
So, we have consistency between using `opkg install apkg` and installing a
package that `DEPENDS:=+apkg` (if there are two providers for `apkg`).

All the best,

Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
 libopkg/pkg_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index 52c64ff..f564b6f 100644
--- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c
@@ -440,7 +440,7 @@  pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t * apkg,
 		for (i = 0; i < matching_pkgs->len; i++) {
 			pkg_t *matching = matching_pkgs->pkgs[i];
 			arch_priority = pkg_get_arch_priority(matching);
-			if (arch_priority > prio) {
+			if (arch_priority >= prio) {
 				priorized_matching = matching;
 				prio = arch_priority;
 				opkg_msg(DEBUG, "Match %s with priority %i.\n",