}
available = pkg_vec_alloc();
pkg_hash_fetch_all_installed(&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 */
pkg->recommends_count = 0;
active_list_init(&pkg->list);
- active_list_init(&pkg->searched_node);
/* Abhaya: added init for conflicts fields */
pkg->conflicts = NULL;
}
ab_pkg->dependencies_checked = 0;
ab_pkg->state_status = SS_NOT_INSTALLED;
- active_list_init(&ab_pkg->searched_node);
return 0;
}
struct abstract_pkg ** depended_upon_by; /* @@@@ this should be abstract_pkg_vec_t -Jamey */
abstract_pkg_vec_t * provided_by;
abstract_pkg_vec_t * replaced_by;
- struct active_list searched_node; /* Used for hash search */
};
#include "pkg_depends.h"
char **suggests_str;
int suggests_count;
struct active_list list; /* Used for installing|upgrading */
- struct active_list searched_node; /* Used for searching */
compound_depend_t * depends;
/* Abhaya: new conflicts */
for (i = 0; i < nprovides; i++) {
abstract_pkg_t *provider_apkg = provided_apkgs[i];
opkg_message(conf, OPKG_DEBUG, " adding %s to providers\n", provider_apkg->name);
- printf(" adding %s to providers\n", provider_apkg->name);
abstract_pkg_vec_insert(providers, provider_apkg);
}
nprovides = providers->len;
}
}
-static int pkg_compare_names(const void *p1, const void *p2)
-{
- const pkg_t *pkg1 = *(const pkg_t **)p1;
- const pkg_t *pkg2 = *(const pkg_t **)p2;
- if (pkg1->name == NULL)
- return 1;
- if (pkg2->name == NULL)
- return -1;
- return(strcmp(pkg1->name, pkg2->name));
-}
-
static void pkg_hash_fetch_available_helper(const char *pkg_name, void *entry, void *data)
{
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);
+ //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);
+ //qsort(all->pkgs, all->len, sizeof(void*), pkg_compare_names);
}
static void pkg_hash_dump_helper(const char *pkg_name, void *entry, void *data)
qsort(vec->pkgs, vec->len, sizeof(pkg_t *), compar);
}
+int pkg_compare_names(const void *p1, const void *p2)
+{
+ const pkg_t *pkg1 = *(const pkg_t **)p1;
+ const pkg_t *pkg2 = *(const pkg_t **)p2;
+ if (pkg1->name == NULL)
+ return 1;
+ if (pkg2->name == NULL)
+ return -1;
+ return(strcmp(pkg1->name, pkg2->name));
+}
+