Make mv_cesa crypto module available on Orion as well.
[openwrt/staging/chunkeey.git] / package / opkg / patches / 013-add-list-changed-conffiles.patch
1 --- a/libopkg/opkg_cmd.c
2 +++ b/libopkg/opkg_cmd.c
3 @@ -617,6 +617,39 @@ opkg_list_installed_cmd(int argc, char *
4 }
5
6 static int
7 +opkg_list_changed_conffiles_cmd(int argc, char **argv)
8 +{
9 + int i ;
10 + pkg_vec_t *available;
11 + pkg_t *pkg;
12 + char *pkg_name = NULL;
13 + conffile_list_elt_t *iter;
14 + conffile_t *cf;
15 +
16 + if (argc > 0) {
17 + pkg_name = argv[0];
18 + }
19 + available = pkg_vec_alloc();
20 + pkg_hash_fetch_all_installed(available);
21 + pkg_vec_sort(available, pkg_compare_names);
22 + for (i=0; i < available->len; i++) {
23 + pkg = available->pkgs[i];
24 + /* if we have package name or pattern and pkg does not match, then skip it */
25 + if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
26 + continue;
27 + if (nv_pair_list_empty(&pkg->conffiles))
28 + continue;
29 + for (iter = nv_pair_list_first(&pkg->conffiles); iter; iter = nv_pair_list_next(&pkg->conffiles, iter)) {
30 + cf = (conffile_t *)iter->data;
31 + if (cf->name && cf->value && conffile_has_been_modified(cf))
32 + printf("%s\n", cf->name);
33 + }
34 + }
35 + pkg_vec_free(available);
36 + return 0;
37 +}
38 +
39 +static int
40 opkg_list_upgradable_cmd(int argc, char **argv)
41 {
42 struct active_list *head = prepare_upgrade_list();
43 @@ -1188,6 +1221,8 @@ static opkg_cmd_t cmds[] = {
44 {"list-installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, PFM_SOURCE},
45 {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE},
46 {"list-upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE},
47 + {"list_changed_conffiles", 0, (opkg_cmd_fun_t)opkg_list_changed_conffiles_cmd, PFM_SOURCE},
48 + {"list-changed-conffiles", 0, (opkg_cmd_fun_t)opkg_list_changed_conffiles_cmd, PFM_SOURCE},
49 {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd, 0},
50 {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd, PFM_DESCRIPTION|PFM_SOURCE},
51 {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd, PFM_DESCRIPTION|PFM_SOURCE},
52 --- a/src/opkg-cl.c
53 +++ b/src/opkg-cl.c
54 @@ -228,6 +228,7 @@ usage()
55 printf("\tlist List available packages\n");
56 printf("\tlist-installed List installed packages\n");
57 printf("\tlist-upgradable List installed and upgradable packages\n");
58 + printf("\tlist-changed-conffiles List user modified configuration files\n");
59 printf("\tfiles <pkg> List files belonging to <pkg>\n");
60 printf("\tsearch <file|regexp> List package providing <file>\n");
61 printf("\tinfo [pkg|regexp] Display all info for <pkg>\n");
62 @@ -331,6 +332,8 @@ main(int argc, char *argv[])
63 !strcmp(cmd_name,"compare-versions") ||
64 !strcmp(cmd_name,"list_installed") ||
65 !strcmp(cmd_name,"list-installed") ||
66 + !strcmp(cmd_name,"list_changed_conffiles") ||
67 + !strcmp(cmd_name,"list-changed-conffiles") ||
68 !strcmp(cmd_name,"status") )
69 noreadfeedsfile = 1;
70