[PATCH] opkg: prioritize the latest provider (not the first)

Peter Stadler peter.stadler at student.uibk.ac.at
Thu Jul 16 10:34:45 EDT 2020


Hi,

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,
Peter

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

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",
-- 
2.25.3




More information about the openwrt-devel mailing list