4 printf("\tinstall <file.opk> Install package <file.opk>\n");
5 printf("\tconfigure [<pkg>] Configure unpacked packages\n");
6 printf("\tremove <pkg|regexp> Remove package <pkg|packages following regexp>\n");
7 - printf("\tflag <flag> <pkg> ... Flag package(s) <pkg>\n");
8 - printf("\t <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation) \n");
10 printf("\nInformational Commands:\n");
11 printf("\tlist List available packages and descriptions\n");
12 --- a/libopkg/opkg_cmd.c
13 +++ b/libopkg/opkg_cmd.c
15 static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv);
16 static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv);
17 static int opkg_purge_cmd(opkg_conf_t *conf, int argc, char **argv);
18 -static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv);
19 static int opkg_files_cmd(opkg_conf_t *conf, int argc, char **argv);
20 static int opkg_search_cmd(opkg_conf_t *conf, int argc, char **argv);
21 static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv);
23 {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd},
24 {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd},
25 {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd},
26 - {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd},
27 {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd},
28 {"install_pending", 0, (opkg_cmd_fun_t)opkg_install_pending_cmd},
29 {"install", 1, (opkg_cmd_fun_t)opkg_install_cmd},
34 -static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv)
38 - const char *flags = argv[0];
41 - signal(SIGINT, sigint_handler);
43 - for (i=1; i < argc; i++) {
44 - if (conf->restrict_to_default_dest) {
45 - pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
47 - conf->default_dest);
49 - pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, argv[i]);
53 - opkg_message(conf, OPKG_ERROR,
54 - "Package %s is not installed.\n", argv[i]);
57 - if (( strcmp(flags,"hold")==0)||( strcmp(flags,"noprune")==0)||
58 - ( strcmp(flags,"user")==0)||( strcmp(flags,"ok")==0)) {
59 - pkg->state_flag = pkg_state_flag_from_str(flags);
61 -/* pb_ asked this feature 03292004 */
62 -/* Actually I will use only this two, but this is an open for various status */
63 - if (( strcmp(flags,"installed")==0)||( strcmp(flags,"unpacked")==0)){
64 - pkg->state_status = pkg_state_status_from_str(flags);
66 - opkg_state_changed++;
67 - opkg_message(conf, OPKG_NOTICE,
68 - "Setting flags for package %s to %s\n",
72 - write_status_files_if_changed(conf);
76 static int opkg_files_cmd(opkg_conf_t *conf, int argc, char **argv)