opkg: update to r503 - reduces peak memory usage by further 20%, rebased patches, restored old config file default
SVN-Revision: 18864master
parent
9e86a8064a
commit
608de32479
@ -1,16 +0,0 @@ |
||||
--- a/libopkg/pkg_hash.c
|
||||
+++ b/libopkg/pkg_hash.c
|
||||
@@ -384,8 +384,11 @@
|
||||
abstract_pkg_t *apkg = NULL;
|
||||
pkg_t *ret;
|
||||
|
||||
- if (!(apkg = abstract_pkg_fetch_by_name(hash, name)))
|
||||
- return NULL;
|
||||
+ if (!(apkg = abstract_pkg_fetch_by_name(hash, name))) {
|
||||
+ if (err)
|
||||
+ *err = 0;
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
ret = pkg_hash_fetch_best_installation_candidate(conf, apkg, pkg_name_constraint_fcn, apkg->name, 0, err);
|
||||
|
@ -1,40 +1,29 @@ |
||||
--- a/libopkg/args.c
|
||||
+++ b/libopkg/args.c
|
||||
@@ -259,7 +259,7 @@
|
||||
|
||||
printf("\nPackage Manipulation:\n");
|
||||
printf("\tupdate Update list of available packages\n");
|
||||
- printf("\tupgrade Upgrade all installed packages to latest version\n");
|
||||
+ printf("\tupgrade <pkg> Upgrade package 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");
|
||||
--- a/libopkg/opkg_cmd.c
|
||||
+++ b/libopkg/opkg_cmd.c
|
||||
@@ -75,7 +75,7 @@
|
||||
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},
|
||||
+ {"upgrade", 1, (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},
|
||||
@@ -607,17 +607,6 @@
|
||||
opkg_install_by_name(conf, arg);
|
||||
@@ -495,17 +495,6 @@
|
||||
opkg_install_by_name(arg);
|
||||
}
|
||||
}
|
||||
- } else {
|
||||
- pkg_vec_t *installed = pkg_vec_alloc();
|
||||
-
|
||||
- pkg_info_preinstall_check(conf);
|
||||
- pkg_info_preinstall_check();
|
||||
-
|
||||
- pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
|
||||
- pkg_hash_fetch_all_installed(installed);
|
||||
- for (i = 0; i < installed->len; i++) {
|
||||
- pkg = installed->pkgs[i];
|
||||
- opkg_upgrade_pkg(conf, pkg);
|
||||
- opkg_upgrade_pkg(pkg);
|
||||
- }
|
||||
- pkg_vec_free(installed);
|
||||
}
|
||||
|
||||
opkg_configure_packages(conf, NULL);
|
||||
opkg_configure_packages(NULL);
|
||||
@@ -1163,7 +1152,7 @@
|
||||
array for easier maintenance */
|
||||
static opkg_cmd_t cmds[] = {
|
||||
{"update", 0, (opkg_cmd_fun_t)opkg_update_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
- {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
+ {"upgrade", 1, (opkg_cmd_fun_t)opkg_upgrade_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
{"list", 0, (opkg_cmd_fun_t)opkg_list_cmd, PFM_SOURCE},
|
||||
{"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, PFM_SOURCE},
|
||||
{"list-installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, PFM_SOURCE},
|
||||
|
@ -1,78 +1,60 @@ |
||||
--- a/libopkg/args.c
|
||||
+++ b/libopkg/args.c
|
||||
@@ -264,8 +264,6 @@
|
||||
printf("\tinstall <file.opk> Install package <file.opk>\n");
|
||||
printf("\tconfigure [<pkg>] Configure unpacked packages\n");
|
||||
printf("\tremove <pkg|regexp> Remove package <pkg|packages following regexp>\n");
|
||||
- printf("\tflag <flag> <pkg> ... Flag package(s) <pkg>\n");
|
||||
- printf("\t <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation) \n");
|
||||
|
||||
printf("\nInformational Commands:\n");
|
||||
printf("\tlist List available packages and descriptions\n");
|
||||
--- a/libopkg/opkg_cmd.c
|
||||
+++ b/libopkg/opkg_cmd.c
|
||||
@@ -54,7 +54,6 @@
|
||||
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);
|
||||
static int opkg_files_cmd(opkg_conf_t *conf, int argc, char **argv);
|
||||
static int opkg_search_cmd(opkg_conf_t *conf, int argc, char **argv);
|
||||
static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv);
|
||||
@@ -80,7 +79,6 @@
|
||||
{"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},
|
||||
{"install_pending", 0, (opkg_cmd_fun_t)opkg_install_pending_cmd},
|
||||
{"install", 1, (opkg_cmd_fun_t)opkg_install_cmd},
|
||||
@@ -960,48 +958,6 @@
|
||||
return 0;
|
||||
@@ -735,49 +735,6 @@
|
||||
}
|
||||
|
||||
-static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv)
|
||||
static int
|
||||
-opkg_flag_cmd(int argc, char **argv)
|
||||
-{
|
||||
- int i;
|
||||
- pkg_t *pkg;
|
||||
- const char *flags = argv[0];
|
||||
-
|
||||
- global_conf = conf;
|
||||
- signal(SIGINT, sigint_handler);
|
||||
-
|
||||
- for (i=1; i < argc; i++) {
|
||||
- if (conf->restrict_to_default_dest) {
|
||||
- pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
|
||||
- argv[i],
|
||||
- pkg = pkg_hash_fetch_installed_by_name_dest(argv[i],
|
||||
- conf->default_dest);
|
||||
- } else {
|
||||
- pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, argv[i]);
|
||||
- pkg = pkg_hash_fetch_installed_by_name(argv[i]);
|
||||
- }
|
||||
-
|
||||
- if (pkg == NULL) {
|
||||
- opkg_message(conf, OPKG_ERROR,
|
||||
- "Package %s is not installed.\n", argv[i]);
|
||||
- opkg_msg(ERROR, "Package %s is not installed.\n", argv[i]);
|
||||
- continue;
|
||||
- }
|
||||
- if (( strcmp(flags,"hold")==0)||( strcmp(flags,"noprune")==0)||
|
||||
- ( strcmp(flags,"user")==0)||( strcmp(flags,"ok")==0)) {
|
||||
- pkg->state_flag = pkg_state_flag_from_str(flags);
|
||||
- }
|
||||
-/* pb_ asked this feature 03292004 */
|
||||
-/* Actually I will use only this two, but this is an open for various status */
|
||||
-
|
||||
- /*
|
||||
- * Useful if a package is installed in an offline_root, and
|
||||
- * should be configured by opkg-cl configure at a later date.
|
||||
- */
|
||||
- if (( strcmp(flags,"installed")==0)||( strcmp(flags,"unpacked")==0)){
|
||||
- pkg->state_status = pkg_state_status_from_str(flags);
|
||||
- }
|
||||
-
|
||||
- opkg_state_changed++;
|
||||
- opkg_message(conf, OPKG_NOTICE,
|
||||
- "Setting flags for package %s to %s\n",
|
||||
- opkg_msg(NOTICE, "Setting flags for package %s to %s.\n",
|
||||
- pkg->name, flags);
|
||||
- }
|
||||
-
|
||||
- write_status_files_if_changed(conf);
|
||||
- write_status_files_if_changed();
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int opkg_files_cmd(opkg_conf_t *conf, int argc, char **argv)
|
||||
-static int
|
||||
opkg_files_cmd(int argc, char **argv)
|
||||
{
|
||||
pkg_t *pkg;
|
||||
@@ -1159,7 +1116,6 @@
|
||||
{"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE},
|
||||
{"list-upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE},
|
||||
{"info", 0, (opkg_cmd_fun_t)opkg_info_cmd, 0},
|
||||
- {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
{"status", 0, (opkg_cmd_fun_t)opkg_status_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
{"install", 1, (opkg_cmd_fun_t)opkg_install_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
{"remove", 1, (opkg_cmd_fun_t)opkg_remove_cmd, PFM_DESCRIPTION|PFM_SOURCE},
|
||||
|
@ -0,0 +1,14 @@ |
||||
--- a/src/opkg-cl.c
|
||||
+++ b/src/opkg-cl.c
|
||||
@@ -169,7 +169,10 @@
|
||||
printf("Confusion: getopt_long returned %d\n", c);
|
||||
}
|
||||
}
|
||||
-
|
||||
+
|
||||
+ if(!conf->conf_file)
|
||||
+ conf->conf_file = "/etc/opkg.conf";
|
||||
+
|
||||
if (parse_err)
|
||||
return parse_err;
|
||||
else
|
Loading…
Reference in new issue