From a460e82adb8a229339e8d5b0e6296876ee37dc34 Mon Sep 17 00:00:00 2001 From: jow Date: Thu, 22 Oct 2009 08:46:55 +0000 Subject: [package] 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 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18119 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/opkg/patches/009-remove-upgrade.patch | 143 ++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 package/opkg/patches/009-remove-upgrade.patch (limited to 'package/opkg/patches/009-remove-upgrade.patch') diff --git a/package/opkg/patches/009-remove-upgrade.patch b/package/opkg/patches/009-remove-upgrade.patch new file mode 100644 index 000000000..1d2f4e91d --- /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 Download and install (and dependencies)\n"); + printf("\tinstall Install package \n"); + printf("\tconfigure [] 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 List all files belonging to \n"); + printf("\tsearch Search for a package providing \n"); + printf("\tinfo [pkg|regexp] Display all info for \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; -- cgit v1.2.3