}
available = pkg_vec_alloc();
pkg_hash_fetch_available(&conf->pkg_hash, available);
+ pkg_vec_sort(available, pkg_compare_names);
for (i=0; i < available->len; i++) {
pkg = available->pkgs[i];
/* if we have package name or pattern and pkg does not match, then skip it */
installed = pkg_vec_alloc();
pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
+ pkg_vec_sort(installed, pkg_compare_names);
for (i=0; i < installed->len; i++) {
pkg = installed->pkgs[i];
pkg_free_installed_files(pkg);
}
- /* XXX: CLEANUP: It's not obvious from the name of
- pkg_hash_fetch_all_installed that we need to call
- pkg_vec_free to avoid a memory leak. */
pkg_vec_free(installed);
return 0;
void pkg_hash_fetch_available(hash_table_t *hash, pkg_vec_t *all)
{
hash_table_foreach(hash, pkg_hash_fetch_available_helper, all);
- //qsort(all->pkgs, all->len, sizeof(pkg_t *), pkg_compare_names);
}
static void pkg_hash_fetch_all_installed_helper(const char *pkg_name, void *entry, void *data)
void pkg_hash_fetch_all_installed(hash_table_t *hash, pkg_vec_t *all)
{
hash_table_foreach(hash, pkg_hash_fetch_all_installed_helper, all);
- //qsort(all->pkgs, all->len, sizeof(void*), pkg_compare_names);
}
static void pkg_hash_dump_helper(const char *pkg_name, void *entry, void *data)