A (presumed) typo in pkg_hash_fetch_best_installation_candidate caused the
matching_pkgs vec to be sorted twice, instead of sorting matching_apkgs.
This fixes both the call and the API to match what appears to be intended.
Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
pkg_vec_sort(matching_pkgs,
pkg_name_version_and_architecture_compare);
if (matching_apkgs->len > 1)
- abstract_pkg_vec_sort(matching_pkgs, abstract_pkg_name_compare);
+ abstract_pkg_vec_sort(matching_apkgs, abstract_pkg_name_compare);
for (i = 0; i < matching_pkgs->len; i++) {
pkg_t *matching = matching_pkgs->pkgs[i];
return 0;
}
-void abstract_pkg_vec_sort(pkg_vec_t * vec, compare_fcn_t compar)
+void abstract_pkg_vec_sort(abstract_pkg_vec_t * vec, compare_fcn_t compar)
{
qsort(vec->pkgs, vec->len, sizeof(pkg_t *), compar);
}
void abstract_pkg_vec_insert(abstract_pkg_vec_t * vec, abstract_pkg_t * pkg);
abstract_pkg_t *abstract_pkg_vec_get(abstract_pkg_vec_t * vec, int i);
int abstract_pkg_vec_contains(abstract_pkg_vec_t * vec, abstract_pkg_t * apkg);
-void abstract_pkg_vec_sort(pkg_vec_t * vec, compare_fcn_t compar);
+void abstract_pkg_vec_sort(abstract_pkg_vec_t * vec, compare_fcn_t compar);
int pkg_compare_names(const void *p1, const void *p2);
#endif