libopkg: selectively load package feeds in opkg_info_status_cmd()
[oweals/opkg-lede.git] / libopkg / opkg_cmd.c
index c50d8f9cf8f72582bc20c55da8510d29f33efb5f..f9d519259053dc51d94837026ba6727fc7ac2051 100644 (file)
@@ -435,14 +435,6 @@ static int opkg_install_cmd(int argc, char **argv)
        char *arg;
        int err = 0;
 
-       if (conf->force_reinstall) {
-               int saved_force_depends = conf->force_depends;
-               conf->force_depends = 1;
-               (void)opkg_remove_cmd(argc, argv);
-               conf->force_depends = saved_force_depends;
-               conf->force_reinstall = 0;
-       }
-
        signal(SIGINT, sigint_handler);
 
        /*
@@ -455,6 +447,18 @@ static int opkg_install_cmd(int argc, char **argv)
                if (opkg_prepare_url_for_install(arg, &argv[i]))
                        return -1;
        }
+
+       pkg_hash_load_package_details();
+       pkg_hash_load_status_files();
+
+       if (conf->force_reinstall) {
+               int saved_force_depends = conf->force_depends;
+               conf->force_depends = 1;
+               (void)opkg_remove_cmd(argc, argv);
+               conf->force_depends = saved_force_depends;
+               conf->force_reinstall = 0;
+       }
+
        pkg_info_preinstall_check();
 
        for (i = 0; i < argc; i++) {
@@ -665,7 +669,7 @@ static int opkg_list_upgradable_cmd(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);
+               _old_pkg = node->pkg;
                _new_pkg =
                    pkg_hash_fetch_best_installation_candidate_by_name
                    (_old_pkg->name);