diff options
Diffstat (limited to 'libopkg')
-rw-r--r-- | libopkg/opkg.c | 6 | ||||
-rw-r--r-- | libopkg/opkg_cmd.c | 6 | ||||
-rw-r--r-- | libopkg/opkg_install.c | 6 | ||||
-rw-r--r-- | libopkg/opkg_upgrade.c | 4 | ||||
-rw-r--r-- | libopkg/pkg_depends.c | 4 | ||||
-rw-r--r-- | libopkg/pkg_hash.c | 9 | ||||
-rw-r--r-- | libopkg/pkg_hash.h | 4 |
7 files changed, 20 insertions, 19 deletions
diff --git a/libopkg/opkg.c b/libopkg/opkg.c index 50f8752..51989f7 100644 --- a/libopkg/opkg.c +++ b/libopkg/opkg.c @@ -411,7 +411,7 @@ opkg_install_package (opkg_t *opkg, const char *package_name, opkg_progress_call 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 */ @@ -924,7 +924,9 @@ opkg_list_upgradable_packages (opkg_t *opkg, opkg_package_callback_t callback, v 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); diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index 82a623e..ca9d9c9 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -629,7 +629,7 @@ static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv) 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" @@ -714,7 +714,9 @@ static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv) 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); diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index 303877e..44aad00 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -1189,7 +1189,7 @@ resolve_conffiles(opkg_conf_t *conf, pkg_t *pkg) 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; @@ -1197,8 +1197,8 @@ opkg_install_by_name(opkg_conf_t *conf, const char *pkg_name) 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__); diff --git a/libopkg/opkg_upgrade.c b/libopkg/opkg_upgrade.c index 8df37d0..f0ae875 100644 --- a/libopkg/opkg_upgrade.c +++ b/libopkg/opkg_upgrade.c @@ -34,7 +34,7 @@ opkg_upgrade_pkg(opkg_conf_t *conf, pkg_t *old) 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, @@ -116,7 +116,7 @@ prepare_upgrade_list(opkg_conf_t *conf) 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; diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c index 998d085..6355fe3 100644 --- a/libopkg/pkg_depends.c +++ b/libopkg/pkg_depends.c @@ -161,7 +161,7 @@ int pkg_hash_fetch_unsatisfied_dependencies(opkg_conf_t *conf, pkg_t * pkg, 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)) { @@ -185,7 +185,7 @@ int pkg_hash_fetch_unsatisfied_dependencies(opkg_conf_t *conf, pkg_t * pkg, 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)) { diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c index ccd3197..907ef0e 100644 --- a/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c @@ -161,7 +161,7 @@ pkg_t * 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; @@ -178,9 +178,6 @@ pkg_hash_fetch_best_installation_candidate(opkg_conf_t *conf, 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; @@ -402,7 +399,7 @@ pkg_vec_fetch_by_name(hash_table_t *hash, const char *pkg_name) 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; @@ -411,7 +408,7 @@ pkg_hash_fetch_best_installation_candidate_by_name(opkg_conf_t *conf, 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); } diff --git a/libopkg/pkg_hash.h b/libopkg/pkg_hash.h index 48c9d69..1c6db86 100644 --- a/libopkg/pkg_hash.h +++ b/libopkg/pkg_hash.h @@ -41,8 +41,8 @@ pkg_t * pkg_hash_fetch_by_name_version(hash_table_t *hash, 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, |