Projects
Kolab:3.4
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 119
View file
cyrus-imapd.spec
Changed
@@ -68,8 +68,8 @@ ## Patch0001: cyrus-imapd-2.5-ctl_mboxlist-mbtype.patch -Patch0002: cyrus-imapd-2.5-default-skiplist.patch -Patch0003: cyrus-imapd-2.5-revert-safe-skiplist.patch +Patch0002: cyrus-imapd-2.5-cyr_info-defaults.patch +Patch0003: working-diff.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
View file
cyrus-imapd-2.5-cyr_info-defaults.patch
Added
@@ -0,0 +1,234 @@ +commit 69ee89675d5ff3e1d73a9189a5ceb967c09357a9 +Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> +Date: Thu Nov 13 23:51:37 2014 +0100 + + cyr_info: Add a command that lists the defaults + +diff --git a/imap/cyr_info.c b/imap/cyr_info.c +index f179025..ccacded 100644 +--- a/imap/cyr_info.c ++++ b/imap/cyr_info.c +@@ -53,7 +53,6 @@ + + #include "global.h" + #include "exitcodes.h" +-#include "libcyr_cfg.h" + #include "proc.h" + #include "util.h" + #include "../master/masterconf.h" +@@ -77,10 +76,11 @@ static void usage(void) + fprintf(stderr, "\n"); + fprintf(stderr, "Where command is one of:\n"); + fprintf(stderr, "\n"); +- fprintf(stderr, " * proc - listing of all open processes\n"); +- fprintf(stderr, " * allconf - listing of all config values\n"); +- fprintf(stderr, " * conf - listing of non-default config values\n"); +- fprintf(stderr, " * lint - unknown config keys\n"); ++ fprintf(stderr, " * conf-all - listing of all config values\n"); ++ fprintf(stderr, " * conf - listing of non-default config values\n"); ++ fprintf(stderr, " * conf-defaults - listing of all default config values\n"); ++ fprintf(stderr, " * conf-lint - unknown config keys\n"); ++ fprintf(stderr, " * proc - listing of all open processes\n"); + cyrus_done(); + exit(-1); + } +@@ -119,66 +119,71 @@ static void do_conf(int only_changed) + + for (i = 1; i < IMAPOPT_LAST; i++) { + switch (imapoptsi.t) { +- case OPT_STRING: +- case OPT_STRINGLIST: +- if (only_changed) { +- const char *defvalue = imapoptsi.def.s; +- char *freeme = NULL; +- +- if (defvalue && +- !strncasecmp(defvalue, "{configdirectory}", 17)) +- { +- freeme = strconcat(imapoptsIMAPOPT_CONFIGDIRECTORY.val.s, +- defvalue+17, (char *)NULL); +- defvalue = freeme; ++ case OPT_BITFIELD: ++ if (only_changed) { ++ if (imapoptsi.def.x == imapoptsi.val.x) break; + } +- if (!strcmpsafe(defvalue, imapoptsi.val.s)) { +- free(freeme); +- break; ++ printf("%s:", imapoptsi.optname); ++ for (j = 0; imapoptsi.enum_optionsj.name; j++) { ++ if (imapoptsi.val.x & (1<<j)) { ++ printf(" %s", imapoptsi.enum_optionsj.name); ++ } + } +- free(freeme); +- } +- printf("%s: %s\n", imapoptsi.optname, imapoptsi.val.s ? imapoptsi.val.s : ""); +- break; +- case OPT_INT: +- if (only_changed) { +- if (imapoptsi.def.i == imapoptsi.val.i) break; +- } +- printf("%s: %ld\n", imapoptsi.optname, imapoptsi.val.i); +- break; +- case OPT_SWITCH: +- if (only_changed) { +- if (imapoptsi.def.b == imapoptsi.val.b) break; +- } +- printf("%s: %s\n", imapoptsi.optname, imapoptsi.val.b ? "yes" : "no"); +- break; +- case OPT_ENUM: +- if (only_changed) { +- if (imapoptsi.def.e == imapoptsi.val.e) break; +- } +- printf("%s:", imapoptsi.optname); +- for (j = 0; imapoptsi.enum_optionsj.name; j++) { +- if (imapoptsi.val.e == imapoptsi.enum_optionsj.val) { +- printf(" %s", imapoptsi.enum_optionsj.name); +- break; ++ printf("\n"); ++ break; ++ ++ case OPT_ENUM: ++ if (only_changed) { ++ if (imapoptsi.def.e == imapoptsi.val.e) break; + } +- } +- printf("\n"); +- break; +- case OPT_BITFIELD: +- if (only_changed) { +- if (imapoptsi.def.x == imapoptsi.val.x) break; +- } +- printf("%s:", imapoptsi.optname); +- for (j = 0; imapoptsi.enum_optionsj.name; j++) { +- if (imapoptsi.val.x & (1<<j)) { +- printf(" %s", imapoptsi.enum_optionsj.name); ++ printf("%s:", imapoptsi.optname); ++ for (j = 0; imapoptsi.enum_optionsj.name; j++) { ++ if (imapoptsi.val.e == imapoptsi.enum_optionsj.val) { ++ printf(" %s", imapoptsi.enum_optionsj.name); ++ break; ++ } + } +- } +- printf("\n"); +- break; +- default: +- abort(); ++ printf("\n"); ++ break; ++ ++ case OPT_INT: ++ if (only_changed) { ++ if (imapoptsi.def.i == imapoptsi.val.i) break; ++ } ++ printf("%s: %ld\n", imapoptsi.optname, imapoptsi.val.i); ++ break; ++ ++ case OPT_STRING: ++ case OPT_STRINGLIST: ++ if (only_changed) { ++ const char *defvalue = imapoptsi.def.s; ++ char *freeme = NULL; ++ ++ if (defvalue && ++ !strncasecmp(defvalue, "{configdirectory}", 17)) ++ { ++ freeme = strconcat(imapoptsIMAPOPT_CONFIGDIRECTORY.val.s, ++ defvalue+17, (char *)NULL); ++ defvalue = freeme; ++ } ++ if (!strcmpsafe(defvalue, imapoptsi.val.s)) { ++ free(freeme); ++ break; ++ } ++ free(freeme); ++ } ++ printf("%s: %s\n", imapoptsi.optname, imapoptsi.val.s ? imapoptsi.val.s : ""); ++ break; ++ ++ case OPT_SWITCH: ++ if (only_changed) { ++ if (imapoptsi.def.b == imapoptsi.val.b) break; ++ } ++ printf("%s: %s\n", imapoptsi.optname, imapoptsi.val.b ? "yes" : "no"); ++ break; ++ ++ default: ++ abort(); + } + } + +@@ -186,6 +191,55 @@ static void do_conf(int only_changed) + config_foreachoverflowstring(print_overflow, NULL); + } + ++static void do_defconf(void) ++{ ++ int i; ++ unsigned j; ++ ++ /* XXX: this is semi-sorted, but the overflow strings aren't sorted at all */ ++ ++ for (i = 1; i < IMAPOPT_LAST; i++) { ++ switch (imapoptsi.t) { ++ case OPT_BITFIELD: ++ printf("%s:", imapoptsi.optname); ++ for (j = 0; imapoptsi.enum_optionsj.name; j++) { ++ if (imapoptsi.def.x & (1<<j)) { ++ printf(" %s", imapoptsi.enum_optionsj.name); ++ } ++ } ++ printf("\n"); ++ break; ++ ++ case OPT_ENUM: ++ printf("%s:", imapoptsi.optname); ++ for (j = 0; imapoptsi.enum_optionsj.name; j++) { ++ if (imapoptsi.val.e == imapoptsi.enum_optionsj.val) { ++ printf(" %s", imapoptsi.enum_optionsj.name); ++ break; ++ } ++ } ++ printf("\n"); ++ break; ++ ++ case OPT_INT: ++ printf("%s: %ld\n", imapoptsi.optname, imapoptsi.def.i); ++ break; ++ ++ case OPT_STRING: ++ case OPT_STRINGLIST: ++ printf("%s: %s\n", imapoptsi.optname, imapoptsi.def.s ? imapoptsi.def.s : ""); ++ break; ++ ++ case OPT_SWITCH: ++ printf("%s: %s\n", imapoptsi.optname, imapoptsi.def.b ? "yes" : "no"); ++ break; ++ ++ default: ++ abort(); ++ } ++ } ++} ++ + static int known_overflowkey(const char *key) + { + /* any partition is OK (XXX: are there name restrictions to check?) */ +@@ -311,11 +365,13 @@ int main(int argc, char *argv) + + if (!strcmp(argvoptind, "proc")) + do_proc(); +- else if (!strcmp(argvoptind, "allconf")) ++ else if (!strcmp(argvoptind, "conf-all")) + do_conf(0); + else if (!strcmp(argvoptind, "conf")) + do_conf(1); +- else if (!strcmp(argvoptind, "lint")) ++ else if (!strcmp(argvoptind, "conf-default")) ++ do_defconf(); ++ else if (!strcmp(argvoptind, "conf-lint")) + do_lint(); + else + usage();
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.