Remove unused parameter from pkg_hash_fetch_best_installation_candidate().
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Fri, 27 Nov 2009 05:32:52 +0000 (05:32 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Fri, 27 Nov 2009 05:32:52 +0000 (05:32 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@397 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg.c
libopkg/opkg_cmd.c
libopkg/opkg_install.c
libopkg/opkg_upgrade.c
libopkg/pkg_depends.c
libopkg/pkg_hash.c
libopkg/pkg_hash.h

index 50f875292b76fa1f4ff79d2480fb72078dc2a2f1..51989f7f16df06a89e36501c6e5fdd92caa5f544 100644 (file)
@@ -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);
index 82a623eeaa365c939f5543e800c5e327a0f2379d..ca9d9c930ea7f0a099c112eccbc6ab637d82c1f5 100644 (file)
@@ -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);
index 303877e496f73967016ce19c676e7040e88fa828..44aad0097b6413413a53dafffeebef3c23b72a15 100644 (file)
@@ -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__);
index 8df37d062d8764f7f4b65a21f7e16f274be90e05..f0ae8754391ff68cf1a19413e5090e3f0ce6f543 100644 (file)
@@ -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;
index 998d08544300fcc69117d389587c6e8a77368762..6355fe3fe4416a202a4d6ef978e481f817fd208d 100644 (file)
@@ -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)) {
index ccd3197f974e2a15dfc54bb93712eee8681bb89a..907ef0e2fba54842f2e05dce1e99ecfc86065ec4 100644 (file)
@@ -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);
 }
 
 
index 48c9d698e32a2c5a6bb62a133644ce8e222f7ee5..1c6db86dd4522b238ee32bae6d8ec756182ac1bd 100644 (file)
@@ -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,