View | Details | Raw Unified | Return to bug 236189 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-8 / +9 lines)
Lines 30-36 Link Here
30
30
31
CONFLICTS=	ja-mutt-[0-9]* ja-mutt-devel-[0-9]* mutt-1.4* mutt-devel-lite-[0-9]* mutt-lite-[0-9]* zh-mutt-devel-[0-9]*
31
CONFLICTS=	ja-mutt-[0-9]* ja-mutt-devel-[0-9]* mutt-1.4* mutt-devel-lite-[0-9]* mutt-lite-[0-9]* zh-mutt-devel-[0-9]*
32
32
33
CONFIGURE_ENV=	CC="${CC} -I${LOCALBASE}/include"
34
CONFIGURE_ARGS=	--disable-fcntl --with-ssl=${OPENSSLBASE} \
33
CONFIGURE_ARGS=	--disable-fcntl --with-ssl=${OPENSSLBASE} \
35
		--with-docdir=${DOCSDIR} --sysconfdir=${PREFIX}/etc \
34
		--with-docdir=${DOCSDIR} --sysconfdir=${PREFIX}/etc \
36
		--enable-external-dotlock --enable-pop --enable-imap \
35
		--enable-external-dotlock --enable-pop --enable-imap \
Lines 130-142 Link Here
130
HCACHE_NONE_CONFIGURE_ON=	--disable-hcache
129
HCACHE_NONE_CONFIGURE_ON=	--disable-hcache
131
HCACHE_NONE_CONFIGURE_OFF=	--enable-hcache --without-qdbm --without-gdbm
130
HCACHE_NONE_CONFIGURE_OFF=	--enable-hcache --without-qdbm --without-gdbm
132
131
133
HCACHE_BDB_CONFIGURE_WITH=	bdb
132
HCACHE_BDB_CONFIGURE_WITH=	bdb=${LOCALBASE}
134
HCACHE_BDB_USES=	bdb:42+
133
HCACHE_BDB_USES=	bdb:42+
135
134
136
HCACHE_TOKYOCABINET_CONFIGURE_WITH=	tokyocabinet
135
HCACHE_TOKYOCABINET_CONFIGURE_WITH=	tokyocabinet=${LOCALBASE}
137
HCACHE_TOKYOCABINET_LIB_DEPENDS=	libtokyocabinet.so:databases/tokyocabinet
136
HCACHE_TOKYOCABINET_LIB_DEPENDS=	libtokyocabinet.so:databases/tokyocabinet
138
137
139
HCACHE_KYOTOCABINET_CONFIGURE_WITH=	kyotocabinet
138
HCACHE_KYOTOCABINET_CONFIGURE_WITH=	kyotocabinet=${LOCALBASE}
140
HCACHE_KYOTOCABINET_LIB_DEPENDS=	libkyotocabinet.so:databases/kyotocabinet
139
HCACHE_KYOTOCABINET_LIB_DEPENDS=	libkyotocabinet.so:databases/kyotocabinet
141
140
142
ICONV_USES=	iconv:translit
141
ICONV_USES=	iconv:translit
Lines 143-149 Link Here
143
ICONV_CONFIGURE_ON=	${ICONV_CONFIGURE_ARG}
142
ICONV_CONFIGURE_ON=	${ICONV_CONFIGURE_ARG}
144
ICONV_CONFIGURE_OFF=	--disable-iconv
143
ICONV_CONFIGURE_OFF=	--disable-iconv
145
144
146
ASPELL_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-aspell
147
REVERSE_REPLY_PATCH_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-reverse_reply
145
REVERSE_REPLY_PATCH_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-reverse_reply
148
146
149
SASL_LIB_DEPENDS=	libsasl2.so:security/cyrus-sasl2
147
SASL_LIB_DEPENDS=	libsasl2.so:security/cyrus-sasl2
Lines 158-164 Link Here
158
156
159
IDN_LIB_DEPENDS=	libidn2.so:dns/libidn2 \
157
IDN_LIB_DEPENDS=	libidn2.so:dns/libidn2 \
160
			libunistring.so:devel/libunistring
158
			libunistring.so:devel/libunistring
161
IDN_CONFIGURE_WITH=	idn2
159
IDN_CONFIGURE_WITH=	idn2=${LOCALBASE}
162
IDN_IMPLIES=	ICONV
160
IDN_IMPLIES=	ICONV
163
161
164
IFDEF_PATCH_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ifdef
162
IFDEF_PATCH_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ifdef
Lines 197-204 Link Here
197
GREETING_PATCH_VERSION=	${PORTVERSION}
195
GREETING_PATCH_VERSION=	${PORTVERSION}
198
.endif
196
.endif
199
197
200
LDFLAGS+=		-L${LOCALBASE}/lib -Wl,-rpath=${LOCALBASE}/lib:/usr/lib -ltinfow
201
202
post-patch-NNTP-on:
198
post-patch-NNTP-on:
203
# Restore timestamps for autotools sources
199
# Restore timestamps for autotools sources
204
	@${TOUCH} -r ${WRKSRC}/configure.ac.orig ${WRKSRC}/configure.ac
200
	@${TOUCH} -r ${WRKSRC}/configure.ac.orig ${WRKSRC}/configure.ac
Lines 241-246 Link Here
241
	@${REINPLACE_CMD} -e 's#$$(docdir)/samples#${EXAMPLESDIR}#g' \
237
	@${REINPLACE_CMD} -e 's#$$(docdir)/samples#${EXAMPLESDIR}#g' \
242
		${WRKSRC}/contrib/Makefile.in
238
		${WRKSRC}/contrib/Makefile.in
243
239
240
pre-configure-ASPELL-on:
241
	${SED} -i '' -e '/^# append-hook/p' \
242
		-e 's/^# append-hook.*$$/set ispell="aspell --mode=email check"/' \
243
	${WRKSRC}/doc/Muttrc.head
244
244
pre-configure-HCACHE_BDB-on:
245
pre-configure-HCACHE_BDB-on:
245
	@${REINPLACE_CMD} -E -e 's/BDB_VERSIONS="/&${BDB_LIB_NAME} db${BDB_VER} /' \
246
	@${REINPLACE_CMD} -E -e 's/BDB_VERSIONS="/&${BDB_LIB_NAME} db${BDB_VER} /' \
246
		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
247
		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
(-)files/extra-patch-aspell (-11 lines)
Lines 1-11 Link Here
1
--- doc/Muttrc.head.orig	2018-05-19 20:33:53 UTC
2
+++ doc/Muttrc.head
3
@@ -35,6 +35,8 @@
4
 # close-hook  '\.gz$'  "gzip -c   '%t' >  '%f'"
5
 # append-hook '\.gz$'  "gzip -c   '%t' >> '%f'"
6
 
7
+set ispell="/usr/local/bin/aspell --mode=email check"
8
+
9
 # If Mutt is unable to determine your site's domain name correctly, you can
10
 # set the default here.
11
 #
(-)files/extra-patch-parent-child-match (-171 lines)
Lines 1-171 Link Here
1
--- doc/manual.xml.head.orig	2017-05-30 19:27:52 UTC
2
+++ doc/manual.xml.head
3
@@ -4265,6 +4265,22 @@ variable <quote>all</quote>, which allow
4
 their system defaults.
5
 </para>
6
 
7
+<para>
8
+<emphasis role="bold">Parent and child match</emphasis>.
9
+You can tell mutt that the following pattern has to be matched against
10
+the parent message with &lt; or one of its childs with &gt;.
11
+This example matches all mails which have at least an unread duplicate
12
+message:
13
+</para>
14
+
15
+<para>
16
+
17
+<screen>
18
+>(~= ~N)
19
+</screen>
20
+
21
+</para>
22
+
23
 </sect2>
24
 
25
 <sect2 id="set-myvar">
26
--- mutt.h.orig	2017-06-03 23:16:03 UTC
27
+++ mutt.h
28
@@ -865,6 +865,8 @@ typedef struct pattern_t
29
   unsigned int alladdr : 1;
30
   unsigned int stringmatch : 1;
31
   unsigned int groupmatch : 1;
32
+  unsigned int parentmatch : 1;
33
+  unsigned int childsmatch : 1;
34
   unsigned int ign_case : 1;		/* ignore case for local stringmatch searches */
35
   unsigned int isalias : 1;
36
   int min;
37
--- pattern.c.orig	2017-05-30 19:26:40 UTC
38
+++ pattern.c
39
@@ -46,6 +46,7 @@ static int eat_regexp (pattern_t *pat, B
40
 static int eat_date (pattern_t *pat, BUFFER *, BUFFER *);
41
 static int eat_range (pattern_t *pat, BUFFER *, BUFFER *);
42
 static int patmatch (const pattern_t *pat, const char *buf);
43
+static int pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx, HEADER *h, pattern_cache_t *cache);
44
 
45
 static const struct pattern_flags
46
 {
47
@@ -781,6 +782,8 @@ pattern_t *mutt_pattern_comp (/* const *
48
   pattern_t *last = NULL;
49
   int not = 0;
50
   int alladdr = 0;
51
+  int parentmatch = 0;
52
+  int childsmatch = 0;
53
   int or = 0;
54
   int implicit = 1;	/* used to detect logical AND operator */
55
   int isalias = 0;
56
@@ -810,6 +813,24 @@ pattern_t *mutt_pattern_comp (/* const *
57
 	ps.dptr++;
58
 	isalias = !isalias;
59
 	break;
60
+      case '<':
61
+	ps.dptr++;
62
+	if (childsmatch) {
63
+	  snprintf (err->data, err->dsize, _("cannot use both < and > as a pattern modifier"));
64
+	  mutt_pattern_free (&curlist);
65
+	  return NULL;
66
+	}
67
+	parentmatch = 1;
68
+	break;
69
+      case '>':
70
+	ps.dptr++;
71
+	if (parentmatch) {
72
+	  snprintf (err->data, err->dsize, _("cannot use both < and > as a pattern modifier"));
73
+	  mutt_pattern_free (&curlist);
74
+	  return NULL;
75
+	}
76
+	childsmatch = 1;
77
+	break;
78
       case '|':
79
 	if (!or)
80
 	{
81
@@ -835,6 +856,8 @@ pattern_t *mutt_pattern_comp (/* const *
82
 	implicit = 0;
83
 	not = 0;
84
 	alladdr = 0;
85
+	parentmatch = 0;
86
+	childsmatch = 0;
87
 	isalias = 0;
88
 	break;
89
       case '%':
90
@@ -865,9 +888,13 @@ pattern_t *mutt_pattern_comp (/* const *
91
 	  last = tmp;
92
 	  tmp->not ^= not;
93
 	  tmp->alladdr |= alladdr;
94
+	  tmp->parentmatch |= parentmatch;
95
+	  tmp->childsmatch |= childsmatch;
96
 	  tmp->isalias |= isalias;
97
 	  not = 0;
98
 	  alladdr = 0;
99
+	  parentmatch = 0;
100
+	  childsmatch = 0;
101
 	  isalias = 0;
102
 	  /* compile the sub-expression */
103
 	  buf = mutt_substrdup (ps.dptr + 1, p);
104
@@ -896,11 +923,15 @@ pattern_t *mutt_pattern_comp (/* const *
105
 	tmp = new_pattern ();
106
 	tmp->not = not;
107
 	tmp->alladdr = alladdr;
108
+	tmp->parentmatch = parentmatch;
109
+	tmp->childsmatch = childsmatch;
110
 	tmp->isalias = isalias;
111
         tmp->stringmatch = (*ps.dptr == '=') ? 1 : 0;
112
         tmp->groupmatch  = (*ps.dptr == '%') ? 1 : 0;
113
 	not = 0;
114
 	alladdr = 0;
115
+	parentmatch = 0;
116
+	childsmatch = 0;
117
 	isalias = 0;
118
 
119
 	if (last)
120
@@ -967,9 +998,13 @@ pattern_t *mutt_pattern_comp (/* const *
121
 	last = tmp;
122
 	tmp->not ^= not;
123
 	tmp->alladdr |= alladdr;
124
+	tmp->parentmatch |= parentmatch;
125
+	tmp->childsmatch |= childsmatch;
126
 	tmp->isalias |= isalias;
127
 	not = 0;
128
 	alladdr = 0;
129
+	parentmatch = 0;
130
+	childsmatch = 0;
131
 	isalias = 0;
132
 	ps.dptr = p + 1; /* restore location */
133
 	break;
134
@@ -1137,6 +1172,37 @@ int
135
 mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx, HEADER *h,
136
                    pattern_cache_t *cache)
137
 {
138
+  THREAD *t;
139
+
140
+  if (pat->parentmatch) {
141
+    if (h->thread && h->thread->parent && h->thread->parent->message)
142
+      return pattern_exec (pat, flags, ctx, h->thread->parent->message, cache);
143
+    else
144
+      return pat->not;
145
+  }
146
+  if (pat->childsmatch) {
147
+    if (!h->thread)
148
+      return pat->not;
149
+    if (!h->thread->child)
150
+      return pat->not;
151
+    t = h->thread->child;
152
+    while (t->prev)
153
+      t = t->prev;
154
+    for (; t; t = t->next) {
155
+      if (!t->message)
156
+	continue;
157
+      if (pattern_exec (pat, flags, ctx, t->message, cache))
158
+	return !pat->not;
159
+    }
160
+    return pat->not;
161
+  }
162
+  return pattern_exec (pat, flags, ctx, h, cache);
163
+}
164
+
165
+static int
166
+pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx, HEADER *h,
167
+			  pattern_cache_t *cache)
168
+{
169
   int result;
170
   int *cache_entry;
171
 

Return to bug 236189