[SVN] r434 -
/branches/idled/debian/patches/23-configurable_idled.dpatch
debian at incase.de
debian at incase.de
Sun May 7 22:01:09 UTC 2006
Author: sven
Date: Mon May 8 00:01:03 2006
New Revision: 434
URL: https://mail.incase.de/viewcvs?rev=434&root=cyrus22&view=rev
Log:
Update 23-configurable_idled patch to work the way HMH favours (set default mode by --with-idle=, use defines or inline functions - defines in this case - to emulate old functions)
Modified:
branches/idled/debian/patches/23-configurable_idled.dpatch
Modified: branches/idled/debian/patches/23-configurable_idled.dpatch
URL: https://mail.incase.de/viewcvs/branches/idled/debian/patches/23-configurable_idled.dpatch?rev=434&root=cyrus22&r1=433&r2=434&view=diff
==============================================================================
--- branches/idled/debian/patches/23-configurable_idled.dpatch (original)
+++ branches/idled/debian/patches/23-configurable_idled.dpatch Mon May 8 00:01:03 2006
@@ -5,30 +5,22 @@
## DP: Adds imapd.conf option to select IDLE method at runtime
@DPATCH@
-diff -urNad idled/configure.in /tmp/dpep.Tv0u6M/idled/configure.in
---- idled/configure.in 2006-05-06 17:26:18.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/configure.in 2006-05-06 17:26:23.914080538 +0200
-@@ -754,17 +754,6 @@
- AC_DEFINE_UNQUOTED(MASTER_PIDFILE, $MASTERPIDFILE,[Name of the pidfile for master])
-
- dnl
--dnl Select a method for IMAP IDLE
--dnl
--AC_ARG_WITH(idle,[ --with-idle=METHOD use METHOD for IMAP IDLE
-- METHOD is [poll], idled or no],
-- WITH_IDLE="${withval}",WITH_IDLE="poll")
--AC_SUBST(WITH_IDLE)
+diff -urNad idled/configure.in /tmp/dpep.oxXZ75/idled/configure.in
+--- idled/configure.in 2006-05-07 23:08:08.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/configure.in 2006-05-07 23:24:12.577295811 +0200
+@@ -760,9 +760,6 @@
+ METHOD is [poll], idled or no],
+ WITH_IDLE="${withval}",WITH_IDLE="poll")
+ AC_SUBST(WITH_IDLE)
-if test "$WITH_IDLE" = "idled"; then
- IMAP_PROGS="$IMAP_PROGS idled"
-fi
--
--dnl
+
+ dnl
dnl see if we're compiling with NNTP support
- dnl
- ENABLE_NNTP=no
-diff -urNad idled/imap/Makefile.in /tmp/dpep.Tv0u6M/idled/imap/Makefile.in
---- idled/imap/Makefile.in 2006-05-06 17:26:18.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/Makefile.in 2006-05-06 17:26:23.914080538 +0200
+diff -urNad idled/imap/Makefile.in /tmp/dpep.oxXZ75/idled/imap/Makefile.in
+--- idled/imap/Makefile.in 2006-05-07 23:08:07.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/Makefile.in 2006-05-07 23:08:20.968639286 +0200
@@ -47,9 +47,6 @@
# 'local' (legacy flat file).
SEEN=seen_db.o
@@ -58,9 +50,9 @@
fud smmapd reconstruct quota mbpath ipurge \
cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
-diff -urNad idled/imap/global.c /tmp/dpep.Tv1u6M/idled/imap/global.c
---- idled/imap/global.c 2006-05-06 18:26:19.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/global.c 2006-05-06 18:26:23.915080444 +0200
+diff -urNad idled/imap/global.c /tmp/dpep.oxXZ75/idled/imap/global.c
+--- idled/imap/global.c 2006-05-07 23:08:08.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/global.c 2006-05-07 23:08:20.969639193 +0200
@@ -94,6 +94,8 @@
/* syslog prefix tag */
static char syslog_prefix[20];
@@ -81,9 +73,9 @@
/* configure libcyrus as needed */
libcyrus_config_setstring(CYRUSOPT_CONFIG_DIR, config_dir);
libcyrus_config_setswitch(CYRUSOPT_AUTH_UNIX_GROUP_ENABLE,
-diff -urNad idled/imap/global.h /tmp/dpep.Tv0u6M/idled/imap/global.h
---- idled/imap/global.h 2006-05-06 17:01:45.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/global.h 2006-05-06 17:26:23.915080444 +0200
+diff -urNad idled/imap/global.h /tmp/dpep.oxXZ75/idled/imap/global.h
+--- idled/imap/global.h 2006-05-06 17:49:52.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/global.h 2006-05-07 23:08:20.969639193 +0200
@@ -152,4 +152,6 @@
extern struct cyrusdb_backend *config_tlscache_db;
extern struct cyrusdb_backend *config_ptscache_db;
@@ -91,9 +83,9 @@
+extern struct idle_backend *config_idle;
+
#endif /* INCLUDED_GLOBAL_H */
-diff -urNad idled/imap/idle.c /tmp/dpep.Tv1u6M/idled/imap/idle.c
+diff -urNad idled/imap/idle.c /tmp/dpep.oxXZ75/idled/imap/idle.c
--- idled/imap/idle.c 1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep.Tv0u6M/idled/imap/idle.c 2006-05-06 18:26:23.915080444 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/idle.c 2006-05-07 23:08:20.969639193 +0200
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
@@ -182,9 +174,9 @@
+
+ return idle;
+}
-diff -urNad idled/imap/idle.h /tmp/dpep.Tv0u6M/idled/imap/idle.h
---- idled/imap/idle.h 2006-05-06 17:01:45.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/idle.h 2006-05-06 17:26:23.916080350 +0200
+diff -urNad idled/imap/idle.h /tmp/dpep.oxXZ75/idled/imap/idle.h
+--- idled/imap/idle.h 2006-05-06 17:49:52.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/idle.h 2006-05-07 23:46:43.255515751 +0200
@@ -45,8 +45,6 @@
#include "mailbox.h"
@@ -194,7 +186,7 @@
typedef enum {
IDLE_MAILBOX = 0x1,
IDLE_ALERT = 0x2
-@@ -54,20 +52,34 @@
+@@ -54,20 +52,42 @@
typedef void idle_updateproc_t(idle_flags_t flags);
@@ -228,6 +220,14 @@
+ void (*done)(struct mailbox *mailbox);
+};
+
++/* Defines to simulate old behaviour */
++/* see struct define above to see what they do */
++#define idle_enabled() (config_idle?config_idle->enabled():false)
++#define idle_init(proc) if (config_idle != NULL) config_idle->init(proc)
++#define idle_start(mbox) if (config_idle != NULL) config_idle->start(mbox)
++#define ide_done(mbox) if (config_idle != NULL) config_idle->done(mbox)
++#define idle_method_desc (config_idle?config_idle->name:NULL)
++
+extern struct idle_backend *idle_backends[];
+
+/* Note that some of these may be undefined symbols
@@ -240,9 +240,9 @@
+struct idle_backend *idle_fromname(const char *name);
#endif
-diff -urNad idled/imap/idle_idled.c /tmp/dpep.Tv0u6M/idled/imap/idle_idled.c
---- idled/imap/idle_idled.c 2006-05-06 17:26:18.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/idle_idled.c 2006-05-06 17:26:23.916080350 +0200
+diff -urNad idled/imap/idle_idled.c /tmp/dpep.oxXZ75/idled/imap/idle_idled.c
+--- idled/imap/idle_idled.c 2006-05-07 23:08:08.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/idle_idled.c 2006-05-07 23:08:20.970639101 +0200
@@ -58,8 +58,6 @@
#include "idled.h"
#include "global.h"
@@ -329,9 +329,9 @@
+ &idle_start,
+ &idle_done
+};
-diff -urNad idled/imap/idle_no.c /tmp/dpep.Tv0u6M/idled/imap/idle_no.c
---- idled/imap/idle_no.c 2006-05-06 17:01:45.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/idle_no.c 2006-05-06 17:26:23.916080350 +0200
+diff -urNad idled/imap/idle_no.c /tmp/dpep.oxXZ75/idled/imap/idle_no.c
+--- idled/imap/idle_no.c 2006-05-06 17:49:52.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/idle_no.c 2006-05-07 23:08:20.970639101 +0200
@@ -42,23 +42,31 @@
#include "idle.h"
@@ -371,9 +371,9 @@
+ &idle_start,
+ &idle_done
+};
-diff -urNad idled/imap/idle_poll.c /tmp/dpep.Tv0u6M/idled/imap/idle_poll.c
---- idled/imap/idle_poll.c 2006-05-06 17:01:45.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/idle_poll.c 2006-05-06 17:26:23.917080256 +0200
+diff -urNad idled/imap/idle_poll.c /tmp/dpep.oxXZ75/idled/imap/idle_poll.c
+--- idled/imap/idle_poll.c 2006-05-06 17:49:52.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/idle_poll.c 2006-05-07 23:08:20.971639008 +0200
@@ -51,15 +51,13 @@
#include "idle.h"
#include "global.h"
@@ -429,96 +429,9 @@
+ &idle_start,
+ &idle_done
+};
-diff -urNad idled/imap/imapd.c /tmp/dpep.Tv1u6M/idled/imap/imapd.c
---- idled/imap/imapd.c 2006-05-06 18:26:19.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/imapd.c 2006-05-06 18:26:23.920079973 +0200
-@@ -558,7 +558,7 @@
- quotadb_open(NULL);
-
- /* setup for sending IMAP IDLE notifications */
-- idle_enabled();
-+ if (config_idle != NULL) ->enabled();
-
- /* create connection to the SNMP listener, if available. */
- snmp_connect(); /* ignore return code */
-@@ -1160,7 +1160,7 @@
- }
- else if (!imapd_userid) goto nologin;
- else if (!strcmp(cmd.s, "Idle")) {
-- if (!idle_enabled()) {
-+ if ((config_idle==NULL) || (!config_idle->enabled())) {
- /* we don't support idle */
- goto badcmd;
- }
-@@ -2202,7 +2202,7 @@
- static struct buf arg;
-
- /* Setup for doing mailbox updates */
-- if (!idle_init(idle_update)) {
-+ if ((config_idle==NULL) || (!config_idle->init(idle_update))) {
- prot_printf(imapd_out,
- "%s NO cannot start idling\r\n", tag);
- return;
-@@ -2214,13 +2214,13 @@
-
- /* Start doing mailbox updates */
- if (imapd_mailbox) index_check(imapd_mailbox, 0, 1);
-- idle_start(imapd_mailbox);
-+ if (config_idle != NULL) config_idle->start(imapd_mailbox);
-
- /* Get continuation data */
- c = getword(imapd_in, &arg);
-
- /* Stop updates and do any necessary cleanup */
-- idle_done(imapd_mailbox);
-+ if (config_idle != NULL) config_idle->done(imapd_mailbox);
-
- if (imapd_mailbox) index_check(imapd_mailbox, 0, 1);
-
-@@ -2273,7 +2273,7 @@
- }
- prot_printf(imapd_out, "* CAPABILITY " CAPABILITY_STRING);
-
-- if (idle_enabled()) {
-+ if ((config_idle != NULL) && (config_idle->enabled())) {
- prot_printf(imapd_out, " IDLE");
- }
-
-diff -urNad idled/imap/lmtpd.c /tmp/dpep.Tv1u6M/idled/imap/lmtpd.c
---- idled/imap/lmtpd.c 2006-05-06 18:26:18.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/lmtpd.c 2006-05-06 18:26:23.921079879 +0200
-@@ -190,7 +190,7 @@
- annotatemore_open(NULL);
-
- /* setup for sending IMAP IDLE notifications */
-- idle_enabled();
-+ if (config_idle != NULL) config_idle->enabled();
-
- /* Set namespace */
- if ((r = mboxname_init_namespace(&lmtpd_namespace, 0)) != 0) {
-diff -urNad idled/imap/pop3d.c /tmp/dpep.Tv0u6M/idled/imap/pop3d.c
---- idled/imap/pop3d.c 2006-05-06 17:26:18.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/pop3d.c 2006-05-06 17:26:58.458830970 +0200
-@@ -89,6 +89,7 @@
- #define DES_DEFS
- #include <krb.h>
-
-+
- /* MIT's kpop authentication kludge */
- char klrealm[REALM_SZ];
- AUTH_DAT kdata;
-@@ -301,7 +302,7 @@
- quotadb_open(NULL);
-
- /* setup for sending IMAP IDLE notifications */
-- idle_enabled();
-+ if (config_idle != NULL) config_idle->enabled();
-
- /* Set namespace */
- if ((r = mboxname_init_namespace(&popd_namespace, 0)) != 0) {
-diff -urNad idled/imap/version.c /tmp/dpep.Tv0u6M/idled/imap/version.c
---- idled/imap/version.c 2006-05-06 17:01:45.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/version.c 2006-05-06 17:30:58.265270187 +0200
+diff -urNad idled/imap/version.c /tmp/dpep.oxXZ75/idled/imap/version.c
+--- idled/imap/version.c 2006-05-06 17:49:52.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/imap/version.c 2006-05-07 23:43:39.767677838 +0200
@@ -62,6 +62,7 @@
#include "map.h"
#include "lock.h"
@@ -527,26 +440,35 @@
#include "idle.h"
#ifdef USE_SIEVE
-@@ -173,9 +174,8 @@
- snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
- " (%s)", krb4_version);
- #endif
-- if (idle_method_desc)
-- snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
-- "; idle = %s", idle_method_desc);
-+ snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
-+ "; idle = %s", (config_idle==NULL?"no":config_idle->name));
-
- prot_printf(pout, " \"environment\" \"%s\"", env_buf);
- }
-diff -urNad idled/lib/imapoptions /tmp/dpep.Tv0u6M/idled/lib/imapoptions
---- idled/lib/imapoptions 2006-05-06 17:26:19.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/lib/imapoptions 2006-05-06 17:26:23.923079691 +0200
+diff -urNad idled/lib/Makefile.in /tmp/dpep.oxXZ75/idled/lib/Makefile.in
+--- idled/lib/Makefile.in 2006-05-07 23:08:07.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/lib/Makefile.in 2006-05-07 23:20:48.482255025 +0200
+@@ -74,6 +74,8 @@
+
+ libdir = @libdir@
+
++IDLE = @WITH_IDLE@
++
+ BUILTSOURCES = imapopts.h imapopts.c
+
+ LIBCYR_HDRS = $(srcdir)/acl.h $(srcdir)/assert.h $(srcdir)/auth.h \
+@@ -132,7 +134,7 @@
+ $(RANLIB) libcyrus_min.a
+
+ imapopts.c: imapoptions $(srcdir)/../tools/config2header
+- $(srcdir)/../tools/config2header CC=$(CC) $(srcdir)/imapopts.c $(srcdir)/imapopts.h < $(srcdir)/imapoptions
++ sed -e "s/%IDLE%/$(IDLE)" < $(srcdir)/imapoptions | $(srcdir)/../tools/config2header CC=$(CC) $(srcdir)/imapopts.c $(srcdir)/imapopts.h
+
+ imapopts.h: imapopts.c
+
+diff -urNad idled/lib/imapoptions /tmp/dpep.oxXZ75/idled/lib/imapoptions
+--- idled/lib/imapoptions 2006-05-07 23:08:10.000000000 +0200
++++ /tmp/dpep.oxXZ75/idled/lib/imapoptions 2006-05-07 23:16:44.683901248 +0200
@@ -248,6 +248,9 @@
/* The password to use for authentication to the backend server hostname
(where hostname is the short hostname of the server) - Cyrus Murder */
-+{ "idlemethod", "idled", STRINGLIST("no", "poll", "idled") }
++{ "idlemethod", "%IDLE%", STRINGLIST("no", "poll", "idled") }
+/* The idle backend to use for IDLE command. */
+
{ "idlesocket", "{configdirectory}/socket/idle", STRING }
More information about the Pkg-Cyrus-imapd-Debian-devel
mailing list