* Rename top level ipkg directory to opkg
[oweals/opkg-lede.git] / pkg_depends.c
index b05381babf1f75b8c1566ea728cf52d2b1799f73..7ebd04e75b49c7820b9149b07f7b0b62d7e3a6c6 100644 (file)
    General Public License for more details.
 */
 
-#include "ipkg.h"
+#include "opkg.h"
 #include <errno.h>
 #include <ctype.h>
    
 #include "pkg.h"
-#include "ipkg_utils.h"
+#include "opkg_utils.h"
 #include "pkg_hash.h"
-#include "ipkg_message.h"
+#include "opkg_message.h"
 #include "pkg_parse.h"
 #include "hash_table.h"
 
@@ -64,7 +64,7 @@ static int pkg_constraint_satisfied(pkg_t *pkg, void *cdata)
 }
 
 /* returns ndependences or negative error value */ 
-int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg, 
+int pkg_hash_fetch_unsatisfied_dependencies(opkg_conf_t *conf, pkg_t * pkg, 
                                            pkg_vec_t *unsatisfied, char *** unresolved)
 {
      pkg_t * satisfier_entry_pkg;
@@ -143,18 +143,18 @@ int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg,
                                            pkg_t *p = tmp_vec->pkgs[i];
                                            if (p->state_want == SW_INSTALL)
                                                continue;
-                                           ipkg_message(conf, IPKG_DEBUG, "not installing %s due to requirement for %s\n", pkg_scout->name, p->name);
+                                           opkg_message(conf, OPKG_DEBUG, "not installing %s due to requirement for %s\n", pkg_scout->name, p->name);
                                            ok = 0;
                                            break;
                                        }
                                        pkg_vec_free (tmp_vec);
                                        if (ok) {
                                            /* mark this one for installation */
-                                           ipkg_message(conf, IPKG_NOTICE, "Adding satisfier for greedy dependence: %s\n", pkg_scout->name);
+                                           opkg_message(conf, OPKG_NOTICE, "Adding satisfier for greedy dependence: %s\n", pkg_scout->name);
                                            pkg_vec_insert(unsatisfied, pkg_scout);
                                        }
                                   } else  {
-                                       ipkg_message(conf, IPKG_DEBUG, "not installing %s due to broken depends \n", pkg_scout->name);
+                                       opkg_message(conf, OPKG_DEBUG, "not installing %s due to broken depends \n", pkg_scout->name);
                                        free (newstuff);
                                   }
                              }
@@ -180,7 +180,7 @@ int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg,
                      satisfying_pkg = NULL;
                   }
                }
-              ipkg_message(conf, IPKG_DEBUG, "%s:%d: satisfying_pkg=%p \n", __FILE__, __LINE__, satisfying_pkg);
+              opkg_message(conf, OPKG_DEBUG, "%s:%d: satisfying_pkg=%p \n", __FILE__, __LINE__, satisfying_pkg);
               if (satisfying_pkg != NULL) {
                    found = 1;
                    break;
@@ -209,12 +209,12 @@ int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg,
                    if (satisfying_pkg != NULL
                        && (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
                        && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
-                        ipkg_message (conf, IPKG_NOTICE, "%s: ignoring recommendation for %s at user request\n",
+                        opkg_message (conf, OPKG_NOTICE, "%s: ignoring recommendation for %s at user request\n",
                                       pkg->name, satisfying_pkg->name);
                         continue;
                    }
 
-                   ipkg_message(conf, IPKG_DEBUG, "%s:%d: satisfying_pkg=%p\n", __FILE__, __LINE__, satisfying_pkg);
+                   opkg_message(conf, OPKG_DEBUG, "%s:%d: satisfying_pkg=%p\n", __FILE__, __LINE__, satisfying_pkg);
                    if (satisfying_pkg != NULL) {
                         satisfier_entry_pkg = satisfying_pkg;
                         break;
@@ -229,13 +229,13 @@ int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg,
                    if (compound_depend->type != RECOMMEND && compound_depend->type != SUGGEST)
                         the_lost = add_unresolved_dep(pkg, the_lost, i);
                    else
-                        ipkg_message (conf, IPKG_NOTICE, "%s: unsatisfied recommendation for %s\n",
+                        opkg_message (conf, OPKG_NOTICE, "%s: unsatisfied recommendation for %s\n",
                                       pkg->name, compound_depend->possibilities[0]->pkg->name);
               }
               else {
                    if (compound_depend->type == SUGGEST) {
                         /* just mention it politely */
-                        ipkg_message (conf, IPKG_NOTICE, "package %s suggests installing %s\n",
+                        opkg_message (conf, OPKG_NOTICE, "package %s suggests installing %s\n",
                                       pkg->name, satisfier_entry_pkg->name);
                    } else {
                         char ** newstuff = NULL;
@@ -276,7 +276,7 @@ int is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg)
 
     for (i = 0; i < replaces_count; i++) {
         if (strcmp(pkg_scout->name,pkg->replaces[i]->name)==0) {      // Found
-            ipkg_message(NULL, IPKG_DEBUG2, "Seems I've found a replace %s %s \n",pkg_scout->name,pkg->replaces[i]->name);
+            opkg_message(NULL, OPKG_DEBUG2, "Seems I've found a replace %s %s \n",pkg_scout->name,pkg->replaces[i]->name);
             return 1;
         }
     }
@@ -392,7 +392,7 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg)
     return 0;
 }
 
-int pkg_dependence_satisfiable(ipkg_conf_t *conf, depend_t *depend)
+int pkg_dependence_satisfiable(opkg_conf_t *conf, depend_t *depend)
 {
      abstract_pkg_t *apkg = depend->pkg;
      abstract_pkg_vec_t *provider_apkgs = apkg->provided_by;
@@ -419,7 +419,7 @@ int pkg_dependence_satisfiable(ipkg_conf_t *conf, depend_t *depend)
      return 0;
 }
 
-int pkg_dependence_satisfied(ipkg_conf_t *conf, depend_t *depend)
+int pkg_dependence_satisfied(opkg_conf_t *conf, depend_t *depend)
 {
      abstract_pkg_t *apkg = depend->pkg;
      abstract_pkg_vec_t *provider_apkgs = apkg->provided_by;
@@ -514,7 +514,7 @@ int pkg_replaces(pkg_t *pkg, pkg_t *replacee)
      for (i = 0; i < replaces_count; i++) {
          abstract_pkg_t *abstract_replacee = replaces[i];
          for (j = 0; j < replaces_count; j++) {
-   /*            ipkg_message(NULL, IPKG_DEBUG2, "Searching pkg-name %s repprovname %s absrepname %s \n",
+   /*            opkg_message(NULL, OPKG_DEBUG2, "Searching pkg-name %s repprovname %s absrepname %s \n",
                  pkg->name,replacee->provides[j]->name, abstract_replacee->name); */
               if (replacee->provides[j] == abstract_replacee)
                    return 1;