opkg: remove unused code
[oweals/opkg-lede.git] / libopkg / opkg_cmd.c
index 94cfb9987c4a52567163c0879a01900294054a10..6eb01eb3638e8799bad08e96a8aa57aa217d20e5 100644 (file)
@@ -72,6 +72,7 @@ static int opkg_whatreplaces_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_compare_versions_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_print_architecture_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_configure_cmd(opkg_conf_t *conf, int argc, char **argv);
+static int pkg_mark_provides(pkg_t *pkg);
 
 /* XXX: CLEANUP: The usage strings should be incorporated into this
    array for easier maintenance */
@@ -138,6 +139,23 @@ opkg_cmd_t *opkg_cmd_find(const char *name)
      return NULL;
 }
 
+void opkg_print_error_list (opkg_conf_t *conf)
+{
+  if ( error_list ) {
+     reverse_error_list(&error_list);
+
+     printf ("Collected errors:\n");
+     /* Here we print the errors collected and free the list */
+     while (error_list != NULL) {
+           printf (" * %s", error_list->errmsg);
+           error_list = error_list->next;
+
+     }
+     free_error_list(&error_list);
+  }
+
+}
+
 int opkg_cmd_exec(opkg_cmd_t *cmd, opkg_conf_t *conf, int argc, const char **argv, void *userdata)
 {
        int result;
@@ -150,20 +168,8 @@ int opkg_cmd_exec(opkg_cmd_t *cmd, opkg_conf_t *conf, int argc, const char **arg
            opkg_message(conf, OPKG_NOTICE, "An error ocurred, return value: %d.\n", result);
         }
 
-        if ( error_list ) {
-           reverse_error_list(&error_list);
-
-           opkg_message(conf, OPKG_NOTICE, "Collected errors:\n");
-           /* Here we print the errors collected and free the list */
-           while (error_list != NULL) {
-                 opkg_message(conf, OPKG_NOTICE, " * %s", error_list->errmsg);
-                 error_list = error_list->next;
+        opkg_print_error_list (conf);
 
-           }
-           free_error_list(&error_list);
-
-        }
-   
        p_userdata = NULL;
        return result;
 }
@@ -295,36 +301,6 @@ static int opkg_update_cmd(opkg_conf_t *conf, int argc, char **argv)
 }
 
 
-/* scan the args passed and cache the local filenames of the packages */
-int opkg_multiple_files_scan(opkg_conf_t *conf, int argc, char **argv)
-{
-     int i;
-     int err;
-    
-     /* 
-      * First scan through package names/urls
-      * For any urls, download the packages and install in database.
-      * For any files, install package info in database.
-      */
-     for (i = 0; i < argc; i ++) {
-         char *filename = argv [i];
-         //char *tmp = basename (tmp);
-         //int tmplen = strlen (tmp);
-
-         //if (strcmp (tmp + (tmplen - strlen (OPKG_PKG_EXTENSION)), OPKG_PKG_EXTENSION) != 0)
-         //     continue;
-         //if (strcmp (tmp + (tmplen - strlen (DPKG_PKG_EXTENSION)), DPKG_PKG_EXTENSION) != 0)
-         //     continue;
-       
-          opkg_message(conf, OPKG_DEBUG2, "Debug mfs: %s  \n",filename );
-
-         err = opkg_prepare_url_for_install(conf, filename, &argv[i]);
-         if (err)
-           return err;
-     }
-     return 0;
-}
-
 struct opkg_intercept
 {
     char *oldpath;
@@ -333,7 +309,7 @@ struct opkg_intercept
 
 typedef struct opkg_intercept *opkg_intercept_t;
 
-opkg_intercept_t opkg_prep_intercepts(opkg_conf_t *conf)
+static opkg_intercept_t opkg_prep_intercepts(opkg_conf_t *conf)
 {
     opkg_intercept_t ctx;
     char *newpath;
@@ -362,7 +338,7 @@ opkg_intercept_t opkg_prep_intercepts(opkg_conf_t *conf)
     return ctx;
 }
 
-int opkg_finalize_intercepts(opkg_intercept_t ctx)
+static int opkg_finalize_intercepts(opkg_intercept_t ctx)
 {
     char *cmd;
     DIR *dir;
@@ -410,7 +386,7 @@ int opkg_finalize_intercepts(opkg_intercept_t ctx)
    used to end recursion and avoid an infinite loop on graph cycles.
    pkg_vec ordered will finally contain the ordered set of packages.
 */
-int opkg_recurse_pkgs_in_order(opkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *all,
+static int opkg_recurse_pkgs_in_order(opkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *all,
                                pkg_vec_t *visited, pkg_vec_t *ordered)
 {
     int j,k,l,m;
@@ -492,7 +468,7 @@ int opkg_recurse_pkgs_in_order(opkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *all,
 
 }
 
-int opkg_configure_packages(opkg_conf_t *conf, char *pkg_name)
+static int opkg_configure_packages(opkg_conf_t *conf, char *pkg_name)
 {
     pkg_vec_t *all, *ordered, *visited;
      int i;
@@ -1324,7 +1300,7 @@ static int opkg_what_depends_conflicts_cmd(opkg_conf_t *conf, enum what_field_ty
      return 0;
 }
 
-int pkg_mark_provides(pkg_t *pkg)
+static int pkg_mark_provides(pkg_t *pkg)
 {
      int provides_count = pkg->provides_count;
      abstract_pkg_t **provides = pkg->provides;