aboutsummaryrefslogtreecommitdiffstats
path: root/package/opkg/patches/009-remove-upgrade.patch
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-10-22 08:46:55 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-10-22 08:46:55 +0000
commit3231dce5aa4afff0c3b4a40f082f13035d9f341f (patch)
treea5c90b0669563b0cb372d372d427cb0aef1d9b26 /package/opkg/patches/009-remove-upgrade.patch
parent991a35c6a621a3b03a0a6de6aa3045b951a7b627 (diff)
downloadupstream-3231dce5aa4afff0c3b4a40f082f13035d9f341f.tar.gz
upstream-3231dce5aa4afff0c3b4a40f082f13035d9f341f.tar.bz2
upstream-3231dce5aa4afff0c3b4a40f082f13035d9f341f.zip
opkg: - replace package list parser by something that works with fixed buffers to avoid slurping the whole file into memory during parsing - fix a possible null pointer dereference in opkg_remove_cmd() - get rid of upgrade, it cannot upgrade single packages and kills the system in most cases - get rid of the flag operation, not needed - bump package revision
SVN-Revision: 18119
Diffstat (limited to 'package/opkg/patches/009-remove-upgrade.patch')
-rw-r--r--package/opkg/patches/009-remove-upgrade.patch143
1 files changed, 143 insertions, 0 deletions
diff --git a/package/opkg/patches/009-remove-upgrade.patch b/package/opkg/patches/009-remove-upgrade.patch
new file mode 100644
index 0000000000..1d2f4e91d7
--- /dev/null
+++ b/package/opkg/patches/009-remove-upgrade.patch
@@ -0,0 +1,143 @@
+--- a/libopkg/args.c
++++ b/libopkg/args.c
+@@ -263,7 +263,6 @@
+
+ printf("\nPackage Manipulation:\n");
+ printf("\tupdate Update list of available packages\n");
+- printf("\tupgrade Upgrade all installed packages to latest version\n");
+ printf("\tinstall <pkg> Download and install <pkg> (and dependencies)\n");
+ printf("\tinstall <file.opk> Install package <file.opk>\n");
+ printf("\tconfigure [<pkg>] Configure unpacked packages\n");
+@@ -274,7 +273,6 @@
+ printf("\nInformational Commands:\n");
+ printf("\tlist List available packages and descriptions\n");
+ printf("\tlist_installed List all and only the installed packages and description \n");
+- printf("\tlist_upgradable List all the installed and upgradable packages\n");
+ printf("\tfiles <pkg> List all files belonging to <pkg>\n");
+ printf("\tsearch <file|regexp> Search for a package providing <file>\n");
+ printf("\tinfo [pkg|regexp] Display all info for <pkg>\n");
+--- a/libopkg/opkg_cmd.c
++++ b/libopkg/opkg_cmd.c
+@@ -48,14 +48,12 @@
+ static void *p_userdata = NULL;
+
+ static int opkg_update_cmd(opkg_conf_t *conf, int argc, char **argv);
+-static int opkg_upgrade_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_list_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_info_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_status_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_install_pending_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_install_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_list_installed_cmd(opkg_conf_t *conf, int argc, char **argv);
+-static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_purge_cmd(opkg_conf_t *conf, int argc, char **argv);
+ static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv);
+@@ -79,10 +77,8 @@
+ array for easier maintenance */
+ static opkg_cmd_t cmds[] = {
+ {"update", 0, (opkg_cmd_fun_t)opkg_update_cmd},
+- {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd},
+ {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd},
+ {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd},
+- {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd},
+ {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd},
+ {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd},
+ {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd},
+@@ -599,69 +595,6 @@
+ return err;
+ }
+
+-static int opkg_upgrade_cmd(opkg_conf_t *conf, int argc, char **argv)
+-{
+- int i;
+- pkg_t *pkg;
+- int err;
+-
+- global_conf = conf;
+- signal(SIGINT, sigint_handler);
+-
+- if (argc) {
+- for (i=0; i < argc; i++) {
+- char *arg = argv[i];
+-
+- err = opkg_prepare_url_for_install(conf, arg, &arg);
+- if (err != EINVAL && err != 0)
+- return err;
+- }
+- pkg_info_preinstall_check(conf);
+-
+- for (i=0; i < argc; i++) {
+- char *arg = argv[i];
+- if (conf->restrict_to_default_dest) {
+- pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
+- argv[i],
+- conf->default_dest);
+- if (pkg == NULL) {
+- opkg_message(conf, OPKG_NOTICE,
+- "Package %s not installed in %s\n",
+- argv[i], conf->default_dest->name);
+- continue;
+- }
+- } else {
+- pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash,
+- argv[i]);
+- }
+- if (pkg)
+- opkg_upgrade_pkg(conf, pkg);
+- else {
+- opkg_install_by_name(conf, arg);
+- }
+- }
+- } else {
+- pkg_vec_t *installed = pkg_vec_alloc();
+-
+- pkg_info_preinstall_check(conf);
+-
+- pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
+- for (i = 0; i < installed->len; i++) {
+- pkg = installed->pkgs[i];
+- opkg_upgrade_pkg(conf, pkg);
+- }
+- pkg_vec_free(installed);
+- }
+-
+- /* recheck to verify that all dependences are satisfied */
+- if (0) opkg_satisfy_all_dependences(conf);
+-
+- opkg_configure_packages(conf, NULL);
+-
+- write_status_files_if_changed(conf);
+-
+- return 0;
+-}
+
+ static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv)
+ {
+@@ -788,26 +721,6 @@
+ return 0;
+ }
+
+-static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv)
+-{
+- struct active_list *head = prepare_upgrade_list(conf);
+- struct active_list *node=NULL;
+- pkg_t *_old_pkg, *_new_pkg;
+- 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);
+- old_v = pkg_version_str_alloc(_old_pkg);
+- new_v = pkg_version_str_alloc(_new_pkg);
+- if (opkg_cb_list)
+- opkg_cb_list(_old_pkg->name, new_v, old_v, _old_pkg->state_status, p_userdata);
+- free(old_v);
+- free(new_v);
+- }
+- active_list_head_delete(head);
+- return 0;
+-}
+-
+ static int opkg_info_status_cmd(opkg_conf_t *conf, int argc, char **argv, int installed_only)
+ {
+ int i;