Re: [PATCH] notmuch new --new-tags=tags...

2010-04-12 Thread Tomas Carnecky
On 4/12/10 1:59 PM, Jameson Rollins wrote: On Mon, 12 Apr 2010 10:00:37 +0200, Sebastian Spaethsebast...@sspaeth.de wrote: On 2010-04-10, Anthony Towns wrote: The attached patch makes notmuch new --new-tags=unread,new set the unread and new tags on any new mail it finds rather than unread

Use of strcasestr

2010-04-12 Thread Tomas Carnecky
In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you introduced strcasestr, which is not portable, see 82e47ec (notmuch reply: Use strstr instead of strcasestr for portability., 2010-02-04). Is strcasestr really necessary there or can it be replaced with strstr? tom

Re: Use of strcasestr

2010-04-12 Thread Tomas Carnecky
On 4/12/10 10:18 PM, Mikhail Gusarov wrote: Twas brillig at 15:58:10 12.04.2010 UTC+02 when t...@dbservice.com did gyre and gimble: TC In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you introduced TC strcasestr, which is not portable, see 82e47ec (notmuch reply: Use

[PATCH] Add compat version of strcasestr

2010-04-12 Thread Tomas Carnecky
strcasestr is not part of any standard (unlike for example strcasecmp) and thus not available on all platforms (in my case Solaris). --- compat/Makefile.local|4 compat/compat.h |4 compat/have_strcasestr.c |8 compat/strcasestr.c | 15

Re: [PATCH] Add simplistic reimplementation of strcasestr to compat library

2010-04-12 Thread Tomas Carnecky
On 4/13/10 6:10 AM, Dirk Hohndel wrote: While all systems that I have access to support strcasestr, it is in fact not part of POSIX. So here's a fallback reimplementation based on POSIX functions. Your patch is missing the part where it adds -DHAVE_STRCASESTR=.. to CONFIGURE_C{XX,}FLAGS.

Re: [PATCH] Add strcasestr v.3 - add compat implementation of strcasestr

2010-04-13 Thread Tomas Carnecky
On 4/13/10 6:47 PM, Dirk Hohndel wrote: v.3 of this patch, now with the changes to makefiles, configure script compat.h and all new files that I need Please test on platforms lacking strcasestr Signed-off-by: Dirk Hohndelhohn...@infradead.org Tested-by: Tomas Carnecky t...@dbservice.com

[PATCH] Use wrapper functions to find the type of struct dirent

2010-04-13 Thread Tomas Carnecky
Some platforms don't provide DT_REG/DT_LNK/DT_DIR. Create wrapper functions which test the presence of those symbols and fall back to stat(2). --- Not sure if I got the handling of DT_UNKNOWN correct in all cases. Someone please double-check that. notmuch-new.c | 70

[PATCH] Wrap the compat header in extern C { } when compiling C++ sources

2010-04-27 Thread Tomas Carnecky
This fixes a build error on OpenSolaris where the final liking of notmuch fails because the linker can't find strcasestr() referenced from thread.cc. --- Is it safe to use NOTMUCH_BEGIN/END_DECLS in the compat header? The sha1 header also uses ifdef __cplusplus instead of that define..

[PATCH] Actually respect LDFLAGS as we say in the ./configure help

2010-04-30 Thread Tomas Carnecky
Signed-off-by: Tomas Carnecky t...@dbservice.com --- configure |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 91e08dd..0153655 100755 --- a/configure +++ b/configure @@ -400,6 +400,9 @@ CFLAGS = ${CFLAGS} # Default FLAGS for C++ compiler

[RFC] Add support for the Solaris platform

2010-04-30 Thread Tomas Carnecky
Like on Mac OS X, the linker doesn't automatically resolve dependencies. Signed-off-by: Tomas Carnecky t...@dbservice.com --- Makefile.local |2 +- configure | 28 ++-- lib/Makefile.local |2 +- notmuch-new.c | 70

[notmuch] [PATCH] Solaris doesn't have 'struct dirent::d_type'

2009-12-20 Thread Tomas Carnecky
Use stat(2) instead. Signed-off-by: Tomas Carnecky --- There is a second issue that prevents notmuch from working on Solaris: the getpwuid_r() prototype doesn't have the last argument. But that can be easily worked around by setting -D_POSIX_PTHREAD_SEMANTICS on the compiler commandline. Do you

[notmuch] [PATCH] Solaris doesn't have 'struct dirent::d_type'

2009-12-21 Thread Tomas Carnecky
On 12/20/09 7:02 PM, James Westby wrote: > From: Tomas Carnecky > > Use stat(2) instead. > > Signed-off-by: Tomas Carnecky > Signed-off-by: James Westby<jw+debian at jameswestby.net> > --- > >The original patch duplicated asprintf and stat calls, rearraging

[notmuch] [PATCH] Add post-add and post-tag hooks

2009-12-22 Thread Tomas Carnecky
it is also invoked when 'notmuch new' adds the two implicit tags (inbox, unread). So make sure your scripts don't choke on that and can be both executed in parallel. Signed-off-by: Tomas Carnecky --- lib/message.cc | 45 ++ notmuch-new.c | 66

[notmuch] [PATCH] Add post-add and post-tag hooks

2009-12-22 Thread Tomas Carnecky
On 12/22/09 3:56 AM, Tomas Carnecky wrote: > The post-add hook is run by 'notmuch new' after each new message is added, > post-tag is run after a tag has been added or removed. The hooks are stored > in the users home directory (~/.notmuch/hooks/). > > Since post-tag is run

[notmuch] [PATCH] Add post-add and post-tag hooks

2009-12-23 Thread Tomas Carnecky
On 12/23/09 12:02 AM, Olly Betts wrote: > Tomas Carnecky writes: >> #if defined(__sun__) >> ... sprintf, stat etc >> #else >> (void) path; >> return dirent->d_type == DT_DIR; >> #endif > > Rather than a platform-specific check, it

[PATCH] notmuch new --new-tags=tags...

2010-04-12 Thread Tomas Carnecky
On 4/12/10 1:59 PM, Jameson Rollins wrote: > On Mon, 12 Apr 2010 10:00:37 +0200, "Sebastian Spaeth" SSpaeth.de> wrote: >> On 2010-04-10, Anthony Towns wrote: >>> The attached patch makes "notmuch new --new-tags=unread,new" set the >>> "unread" and "new" tags on any new mail it finds rather than

Use of strcasestr

2010-04-12 Thread Tomas Carnecky
In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you introduced strcasestr, which is not portable, see 82e47ec (notmuch reply: Use strstr instead of strcasestr for portability., 2010-02-04). Is strcasestr really necessary there or can it be replaced with strstr? tom

Use of strcasestr

2010-04-13 Thread Tomas Carnecky
On 4/12/10 10:18 PM, Mikhail Gusarov wrote: > > Twas brillig at 15:58:10 12.04.2010 UTC+02 when tom at dbservice.com did gyre > and gimble: > > TC> In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you > introduced > TC> strcasestr, which is not portable, see 82e47ec

[PATCH] Add compat version of strcasestr

2010-04-13 Thread Tomas Carnecky
strcasestr is not part of any standard (unlike for example strcasecmp) and thus not available on all platforms (in my case Solaris). --- compat/Makefile.local|4 compat/compat.h |4 compat/have_strcasestr.c |8 compat/strcasestr.c | 15

[PATCH] Add simplistic reimplementation of strcasestr to compat library

2010-04-13 Thread Tomas Carnecky
On 4/13/10 6:10 AM, Dirk Hohndel wrote: > > While all systems that I have access to support strcasestr, it is > in fact not part of POSIX. So here's a fallback reimplementation > based on POSIX functions. Your patch is missing the part where it adds -DHAVE_STRCASESTR=.. to CONFIGURE_C{XX,}FLAGS.

[PATCH] Add strcasestr v.3 - add compat implementation of strcasestr

2010-04-13 Thread Tomas Carnecky
On 4/13/10 6:47 PM, Dirk Hohndel wrote: > > v.3 of this patch, now with the changes to makefiles, configure script > compat.h and all new files that I need > Please test on platforms lacking strcasestr > > Signed-off-by: Dirk Hohndel Tested-by: Tomas Carnecky (on OpenSolaris snv_134) tom

[PATCH] Use wrapper functions to find the type of struct dirent

2010-04-13 Thread Tomas Carnecky
Some platforms don't provide DT_REG/DT_LNK/DT_DIR. Create wrapper functions which test the presence of those symbols and fall back to stat(2). --- Not sure if I got the handling of DT_UNKNOWN correct in all cases. Someone please double-check that. notmuch-new.c | 70

[PATCH] Wrap the compat header in extern "C" { } when compiling C++ sources

2010-04-27 Thread Tomas Carnecky
This fixes a build error on OpenSolaris where the final liking of notmuch fails because the linker can't find strcasestr() referenced from thread.cc. --- Is it safe to use NOTMUCH_BEGIN/END_DECLS in the compat header? The sha1 header also uses ifdef __cplusplus instead of that define..

[PATCH] Actually respect LDFLAGS as we say in the ./configure help

2010-04-30 Thread Tomas Carnecky
Signed-off-by: Tomas Carnecky --- configure |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 91e08dd..0153655 100755 --- a/configure +++ b/configure @@ -400,6 +400,9 @@ CFLAGS = ${CFLAGS} # Default FLAGS for C++ compiler (can be overridden

[RFC] Add support for the Solaris platform

2010-04-30 Thread Tomas Carnecky
Like on Mac OS X, the linker doesn't automatically resolve dependencies. Signed-off-by: Tomas Carnecky --- Makefile.local |2 +- configure | 28 ++-- lib/Makefile.local |2 +- notmuch-new.c | 70