2009-10-22 08:46:55 +00:00
|
|
|
--- a/libopkg/opkg_cmd.c
|
|
|
|
+++ b/libopkg/opkg_cmd.c
|
2010-01-07 12:37:49 +00:00
|
|
|
@@ -738,49 +738,6 @@
|
2009-10-22 08:46:55 +00:00
|
|
|
}
|
|
|
|
|
2009-12-20 21:21:14 +00:00
|
|
|
static int
|
|
|
|
-opkg_flag_cmd(int argc, char **argv)
|
2009-10-22 08:46:55 +00:00
|
|
|
-{
|
|
|
|
- int i;
|
|
|
|
- pkg_t *pkg;
|
|
|
|
- const char *flags = argv[0];
|
|
|
|
-
|
|
|
|
- signal(SIGINT, sigint_handler);
|
|
|
|
-
|
|
|
|
- for (i=1; i < argc; i++) {
|
|
|
|
- if (conf->restrict_to_default_dest) {
|
2009-12-20 21:21:14 +00:00
|
|
|
- pkg = pkg_hash_fetch_installed_by_name_dest(argv[i],
|
2009-10-22 08:46:55 +00:00
|
|
|
- conf->default_dest);
|
|
|
|
- } else {
|
2009-12-20 21:21:14 +00:00
|
|
|
- pkg = pkg_hash_fetch_installed_by_name(argv[i]);
|
2009-10-22 08:46:55 +00:00
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (pkg == NULL) {
|
2009-12-20 21:21:14 +00:00
|
|
|
- opkg_msg(ERROR, "Package %s is not installed.\n", argv[i]);
|
2009-10-22 08:46:55 +00:00
|
|
|
- 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);
|
|
|
|
- }
|
2009-12-20 21:21:14 +00:00
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Useful if a package is installed in an offline_root, and
|
|
|
|
- * should be configured by opkg-cl configure at a later date.
|
|
|
|
- */
|
2009-10-22 08:46:55 +00:00
|
|
|
- if (( strcmp(flags,"installed")==0)||( strcmp(flags,"unpacked")==0)){
|
|
|
|
- pkg->state_status = pkg_state_status_from_str(flags);
|
|
|
|
- }
|
2009-12-20 21:21:14 +00:00
|
|
|
-
|
2009-10-22 08:46:55 +00:00
|
|
|
- opkg_state_changed++;
|
2009-12-20 21:21:14 +00:00
|
|
|
- opkg_msg(NOTICE, "Setting flags for package %s to %s.\n",
|
2009-10-22 08:46:55 +00:00
|
|
|
- pkg->name, flags);
|
|
|
|
- }
|
|
|
|
-
|
2009-12-20 21:21:14 +00:00
|
|
|
- write_status_files_if_changed();
|
2009-10-22 08:46:55 +00:00
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
2009-12-20 21:21:14 +00:00
|
|
|
-static int
|
|
|
|
opkg_files_cmd(int argc, char **argv)
|
2009-10-22 08:46:55 +00:00
|
|
|
{
|
|
|
|
pkg_t *pkg;
|
2010-01-07 12:37:49 +00:00
|
|
|
@@ -1162,7 +1119,6 @@
|
2009-12-20 21:21:14 +00:00
|
|
|
{"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},
|