return OPKG_PACKAGE_ALREADY_INSTALLED;
}
- new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, package_name, NULL);
+ new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, package_name);
if (!new)
{
/* XXX: Error: Could not find package to install */
head = prepare_upgrade_list(opkg->conf);
for (node=active_list_next(head, head); node; active_list_next(head,node)) {
old = list_entry(node, pkg_t, list);
- new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, old->name, NULL);
+ new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, old->name);
+ if (new == NULL)
+ continue;
package = pkg_t_to_opkg_package_t (new);
callback (opkg, package, user_data);
opkg_package_free (package);
for (i = 0; i < argc; i++) {
arg = argv[i];
- pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, arg, &err);
+ pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, arg);
if (pkg == NULL) {
opkg_message(conf, OPKG_ERROR,
"Cannot find package %s.\n"
char *old_v, *new_v;
for (node = active_list_next(head, head); node;node = active_list_next(head,node)) {
_old_pkg = list_entry(node, pkg_t, list);
- _new_pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, _old_pkg->name, NULL);
+ _new_pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, _old_pkg->name);
+ if (_new_pkg == NULL)
+ continue;
old_v = pkg_version_str_alloc(_old_pkg);
new_v = pkg_version_str_alloc(_new_pkg);
printf("%s - %s - %s\n", _old_pkg->name, old_v, new_v);
int
opkg_install_by_name(opkg_conf_t *conf, const char *pkg_name)
{
- int cmp, err = 0;
+ int cmp;
pkg_t *old, *new;
char *old_version, *new_version;
if (old)
opkg_message(conf, OPKG_DEBUG2, "Old versions from pkg_hash_fetch %s \n", old->version);
- new = pkg_hash_fetch_best_installation_candidate_by_name(conf, pkg_name, &err);
- if (new == NULL || err)
+ new = pkg_hash_fetch_best_installation_candidate_by_name(conf, pkg_name);
+ if (new == NULL)
return -1;
opkg_message(conf, OPKG_DEBUG2, "Versions from pkg_hash_fetch in %s ", __FUNCTION__);
return 0;
}
- new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name, NULL);
+ new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name);
if (new == NULL) {
old_version = pkg_version_str_alloc(old);
opkg_message(conf, OPKG_NOTICE,
int cmp;
old = list_entry(node, pkg_t, list);
- new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name, NULL);
+ new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name);
if (new == NULL)
continue;
pkg_t *satisfying_pkg =
pkg_hash_fetch_best_installation_candidate(conf, satisfying_apkg,
pkg_installed_and_constraint_satisfied,
- dependence_to_satisfy, 1, NULL);
+ dependence_to_satisfy, 1);
/* Being that I can't test constraing in pkg_hash, I will test it here */
if (satisfying_pkg != NULL) {
if (!pkg_installed_and_constraint_satisfied ( satisfying_pkg,dependence_to_satisfy)) {
pkg_t *satisfying_pkg =
pkg_hash_fetch_best_installation_candidate(conf, satisfying_apkg,
pkg_constraint_satisfied,
- dependence_to_satisfy, 1, NULL);
+ dependence_to_satisfy, 1);
/* Being that I can't test constraing in pkg_hash, I will test it here too */
if (satisfying_pkg != NULL) {
if (!pkg_constraint_satisfied ( satisfying_pkg,dependence_to_satisfy)) {
pkg_hash_fetch_best_installation_candidate(opkg_conf_t *conf,
abstract_pkg_t *apkg,
int (*constraint_fcn)(pkg_t *pkg, void *cdata),
- void *cdata, int quiet, int *err)
+ void *cdata, int quiet)
{
int i;
int nprovides = 0;
pkg_t *held_pkg = NULL;
pkg_t *good_pkg_by_name = NULL;
- if (err)
- *err = 0;
-
if (apkg == NULL || apkg->provided_by == NULL || (apkg->provided_by->len == 0))
return NULL;
pkg_t *
pkg_hash_fetch_best_installation_candidate_by_name(opkg_conf_t *conf,
- const char *name, int *err)
+ const char *name)
{
hash_table_t *hash = &conf->pkg_hash;
abstract_pkg_t *apkg = NULL;
return NULL;
return pkg_hash_fetch_best_installation_candidate(conf, apkg,
- pkg_name_constraint_fcn, apkg->name, 0, err);
+ pkg_name_constraint_fcn, apkg->name, 0);
}
const char *pkg_name,
const char * version);
pkg_t *pkg_hash_fetch_best_installation_candidate(opkg_conf_t *conf, abstract_pkg_t *apkg,
- int (*constraint_fcn)(pkg_t *pkg, void *data), void *cdata, int quiet, int *error);
-pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(opkg_conf_t *conf, const char *name, int *err);
+ int (*constraint_fcn)(pkg_t *pkg, void *data), void *cdata, int quiet);
+pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(opkg_conf_t *conf, const char *name);
pkg_t *pkg_hash_fetch_installed_by_name(hash_table_t *hash,
const char *pkg_name);
pkg_t *pkg_hash_fetch_installed_by_name_dest(hash_table_t *hash,