Re: [PATCH] doc: Allow rst2man.py as an alternative to rst2man
[notmuch-archives.git] / d1 / 917e0181a8db6794719d38310e0ae4f229cd57
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id E24ED414B99\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 04:17:23 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id sPq+F+Txzq6B for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Apr 2012 04:17:22 -0700 (PDT)\r
17 Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com\r
18         [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id A8E0A414B96\r
21         for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 04:17:22 -0700 (PDT)\r
22 Received: by pbcuo1 with SMTP id uo1so5664086pbc.26\r
23         for <notmuch@notmuchmail.org>; Mon, 09 Apr 2012 04:17:22 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
27         :cc:content-type:x-gm-message-state;\r
28         bh=E+XhC5NXOKVzDJcPVfP59TOgg4Ulya0BCUPpoIzpbPo=;\r
29         b=kRWJRVqNH/Z/gP2XTu4t4E2ze92asyFc1PZkORF5CeQqQUia1FOma/wyAwTapeEwFC\r
30         9+Gl4nHpCI3tjML9P/10jbtuqWYeeRTQpvgIjZV4i2mGLKp1OlZaADHcsfYx3kAG7gM1\r
31         8gpw6dWkI32xveQZb5Gr5B8ZHSz41wqlQQnpmSNpE2vcAFxkr63bmqeF8bqdNnBP/EPD\r
32         9TnkkOg7zxLSQmhM/ycmQ59f56gneSAb+QfA6FaXXZFY66MoVGIX2a4HmOy+ERi+h5cy\r
33         uxlcScnCg3uY2Iu39PVU2WvSteytNLkIqtEKuCj1en+dHmSRVm2PAjQJREuf1BKO36C6\r
34         eM+w==\r
35 MIME-Version: 1.0\r
36 Received: by 10.68.223.36 with SMTP id qr4mr6141349pbc.54.1333970241762; Mon,\r
37         09 Apr 2012 04:17:21 -0700 (PDT)\r
38 Received: by 10.68.241.234 with HTTP; Mon, 9 Apr 2012 04:17:21 -0700 (PDT)\r
39 Received: by 10.68.241.234 with HTTP; Mon, 9 Apr 2012 04:17:21 -0700 (PDT)\r
40 In-Reply-To: <1333966665-10469-3-git-send-email-Vladimir.Marek@oracle.com>\r
41 References: <1333966665-10469-1-git-send-email-Vladimir.Marek@oracle.com>\r
42         <1333966665-10469-3-git-send-email-Vladimir.Marek@oracle.com>\r
43 Date: Mon, 9 Apr 2012 14:17:21 +0300\r
44 Message-ID:\r
45  <CAB+hUn_gFp+bspNFa-4e6hnH077Sx3to8jZGo1MSwt82QFwxwQ@mail.gmail.com>\r
46 Subject: Re: [PATCH 2/4] dirent->d_type not available on Soalris\r
47 From: Jani Nikula <jani@nikula.org>\r
48 To: Vladimir.Marek@oracle.com\r
49 Content-Type: multipart/alternative; boundary=047d7b2e09bd66b3a104bd3d2610\r
50 X-Gm-Message-State:\r
51  ALoCoQn/5FrY6tb5qa1fPucNshwvazO+3HkQ/jO3eKVmUcZIlXykxJPu43ANXX0rrAOxqspGSz9s\r
52 Cc: Notmuch Mail <notmuch@notmuchmail.org>, Vladimir Marek <vlmarek@volny.cz>\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Mon, 09 Apr 2012 11:17:24 -0000\r
66 \r
67 --047d7b2e09bd66b3a104bd3d2610\r
68 Content-Type: text/plain; charset=UTF-8\r
69 \r
70 On Apr 9, 2012 1:18 PM, <Vladimir.Marek@oracle.com> wrote:\r
71 >\r
72 > From: Vladimir Marek <vlmarek@volny.cz>\r
73 >\r
74 > The inspiration was taken from similar issue in mutt:\r
75 > http://does-not-exist.org/mail-archives/mutt-dev/msg11290.html\r
76 >\r
77 > Signed-off-by: Vladimir Marek <vlmarek@volny.cz>\r
78 > ---\r
79 >  notmuch-new.c |   19 +++++++++++++------\r
80 >  1 files changed, 13 insertions(+), 6 deletions(-)\r
81 >\r
82 > diff --git a/notmuch-new.c b/notmuch-new.c\r
83 > index 4f13535..20bc580 100644\r
84 > --- a/notmuch-new.c\r
85 > +++ b/notmuch-new.c\r
86 > @@ -21,6 +21,7 @@\r
87 >  #include "notmuch-client.h"\r
88 >\r
89 >  #include <unistd.h>\r
90 > +#include <sys/types.h>\r
91 >\r
92 >  typedef struct _filename_node {\r
93 >     char *filename;\r
94 > @@ -165,9 +166,12 @@ static int\r
95 >  _entries_resemble_maildir (struct dirent **entries, int count)\r
96 >  {\r
97 >     int i, found = 0;\r
98 > +    struct stat statbuf;\r
99 >\r
100 >     for (i = 0; i < count; i++) {\r
101 > -       if (entries[i]->d_type != DT_DIR && entries[i]->d_type !=\r
102 DT_UNKNOWN)\r
103 > +       if (stat(entries[i]->d_name, &statbuf) == -1)\r
104 > +               continue;\r
105 > +       if (! S_ISDIR(statbuf.st_mode))\r
106 \r
107 Notmuch new is possibly one of the most performance critical bits for\r
108 people with, uh, much mail. The performance impact of the new syscalls\r
109 should be measured. (Can't do this myself atm.)\r
110 \r
111 BR,\r
112 Jani.\r
113 \r
114 >            continue;\r
115 >\r
116 >        if (strcmp(entries[i]->d_name, "new") == 0 ||\r
117 > @@ -258,6 +262,7 @@ add_files_recursive (notmuch_database_t *notmuch,\r
118 >     struct stat st;\r
119 >     notmuch_bool_t is_maildir, new_directory;\r
120 >     const char **tag;\r
121 > +    struct stat statbuf;\r
122 >\r
123 >     if (stat (path, &st)) {\r
124 >        fprintf (stderr, "Error reading directory %s: %s\n",\r
125 > @@ -321,6 +326,9 @@ add_files_recursive (notmuch_database_t *notmuch,\r
126 >\r
127 >        entry = fs_entries[i];\r
128 >\r
129 > +       if (stat(entry->d_name, &statbuf) == -1)\r
130 > +               continue;\r
131 > +\r
132 >        /* We only want to descend into directories.\r
133 >         * But symlinks can be to directories too, of course.\r
134 >         *\r
135 > @@ -328,9 +336,8 @@ add_files_recursive (notmuch_database_t *notmuch,\r
136 >         * scandir results, then it might be a directory (and if not,\r
137 >         * then we'll stat and return immediately in the next level of\r
138 >         * recursion). */\r
139 > -       if (entry->d_type != DT_DIR &&\r
140 > -           entry->d_type != DT_LNK &&\r
141 > -           entry->d_type != DT_UNKNOWN)\r
142 > +       if (!(statbuf.st_mode & S_IFDIR) &&\r
143 > +           !(statbuf.st_mode & S_IFLNK))\r
144 >        {\r
145 >            continue;\r
146 >        }\r
147 > @@ -427,7 +434,7 @@ add_files_recursive (notmuch_database_t *notmuch,\r
148 >         *\r
149 >         * In either case, a stat does the trick.\r
150 >         */\r
151 > -       if (entry->d_type == DT_LNK || entry->d_type == DT_UNKNOWN) {\r
152 > +       if (stat(entry->d_name, &statbuf) == -1 || statbuf.st_mode &\r
153 S_IFLNK) {\r
154 >            int err;\r
155 >\r
156 >            next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);\r
157 > @@ -443,7 +450,7 @@ add_files_recursive (notmuch_database_t *notmuch,\r
158 >\r
159 >            if (! S_ISREG (st.st_mode))\r
160 >                continue;\r
161 > -       } else if (entry->d_type != DT_REG) {\r
162 > +       } else if ( statbuf.st_mode & S_IFREG) {\r
163 >            continue;\r
164 >        }\r
165 >\r
166 > --\r
167 > 1.7.3.2\r
168 >\r
169 > _______________________________________________\r
170 > notmuch mailing list\r
171 > notmuch@notmuchmail.org\r
172 > http://notmuchmail.org/mailman/listinfo/notmuch\r
173 \r
174 --047d7b2e09bd66b3a104bd3d2610\r
175 Content-Type: text/html; charset=UTF-8\r
176 Content-Transfer-Encoding: quoted-printable\r
177 \r
178 <p><br>\r
179 On Apr 9, 2012 1:18 PM, &lt;<a href=3D"mailto:Vladimir.Marek@oracle.com">Vl=\r
180 adimir.Marek@oracle.com</a>&gt; wrote:<br>\r
181 &gt;<br>\r
182 &gt; From: Vladimir Marek &lt;<a href=3D"mailto:vlmarek@volny.cz">vlmarek@v=\r
183 olny.cz</a>&gt;<br>\r
184 &gt;<br>\r
185 &gt; The inspiration was taken from similar issue in mutt:<br>\r
186 &gt; <a href=3D"http://does-not-exist.org/mail-archives/mutt-dev/msg11290.h=\r
187 tml">http://does-not-exist.org/mail-archives/mutt-dev/msg11290.html</a><br>\r
188 &gt;<br>\r
189 &gt; Signed-off-by: Vladimir Marek &lt;<a href=3D"mailto:vlmarek@volny.cz">=\r
190 vlmarek@volny.cz</a>&gt;<br>\r
191 &gt; ---<br>\r
192 &gt; =C2=A0notmuch-new.c | =C2=A0 19 +++++++++++++------<br>\r
193 &gt; =C2=A01 files changed, 13 insertions(+), 6 deletions(-)<br>\r
194 &gt;<br>\r
195 &gt; diff --git a/notmuch-new.c b/notmuch-new.c<br>\r
196 &gt; index 4f13535..20bc580 100644<br>\r
197 &gt; --- a/notmuch-new.c<br>\r
198 &gt; +++ b/notmuch-new.c<br>\r
199 &gt; @@ -21,6 +21,7 @@<br>\r
200 &gt; =C2=A0#include &quot;notmuch-client.h&quot;<br>\r
201 &gt;<br>\r
202 &gt; =C2=A0#include &lt;unistd.h&gt;<br>\r
203 &gt; +#include &lt;sys/types.h&gt;<br>\r
204 &gt;<br>\r
205 &gt; =C2=A0typedef struct _filename_node {<br>\r
206 &gt; =C2=A0 =C2=A0 char *filename;<br>\r
207 &gt; @@ -165,9 +166,12 @@ static int<br>\r
208 &gt; =C2=A0_entries_resemble_maildir (struct dirent **entries, int count)<b=\r
209 r>\r
210 &gt; =C2=A0{<br>\r
211 &gt; =C2=A0 =C2=A0 int i, found =3D 0;<br>\r
212 &gt; + =C2=A0 =C2=A0struct stat statbuf;<br>\r
213 &gt;<br>\r
214 &gt; =C2=A0 =C2=A0 for (i =3D 0; i &lt; count; i++) {<br>\r
215 &gt; - =C2=A0 =C2=A0 =C2=A0 if (entries[i]-&gt;d_type !=3D DT_DIR &amp;&amp=\r
216 ; entries[i]-&gt;d_type !=3D DT_UNKNOWN)<br>\r
217 &gt; + =C2=A0 =C2=A0 =C2=A0 if (stat(entries[i]-&gt;d_name, &amp;statbuf) =\r
218 =3D=3D -1)<br>\r
219 &gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;<br>\r
220 &gt; + =C2=A0 =C2=A0 =C2=A0 if (! S_ISDIR(statbuf.st_mode))</p>\r
221 <p>Notmuch new is possibly one of the most performance critical bits for pe=\r
222 ople with, uh, much mail. The performance impact of the new syscalls should=\r
223  be measured. (Can&#39;t do this myself atm.)</p>\r
224 <p>BR,<br>\r
225 Jani. <br></p>\r
226 <p>&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>\r
227 &gt;<br>\r
228 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0if (strcmp(entries[i]-&gt;d_name, &quot;new=\r
229 &quot;) =3D=3D 0 ||<br>\r
230 &gt; @@ -258,6 +262,7 @@ add_files_recursive (notmuch_database_t *notmuch,<=\r
231 br>\r
232 &gt; =C2=A0 =C2=A0 struct stat st;<br>\r
233 &gt; =C2=A0 =C2=A0 notmuch_bool_t is_maildir, new_directory;<br>\r
234 &gt; =C2=A0 =C2=A0 const char **tag;<br>\r
235 &gt; + =C2=A0 =C2=A0struct stat statbuf;<br>\r
236 &gt;<br>\r
237 &gt; =C2=A0 =C2=A0 if (stat (path, &amp;st)) {<br>\r
238 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0fprintf (stderr, &quot;Error reading direct=\r
239 ory %s: %s\n&quot;,<br>\r
240 &gt; @@ -321,6 +326,9 @@ add_files_recursive (notmuch_database_t *notmuch,<=\r
241 br>\r
242 &gt;<br>\r
243 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0entry =3D fs_entries[i];<br>\r
244 &gt;<br>\r
245 &gt; + =C2=A0 =C2=A0 =C2=A0 if (stat(entry-&gt;d_name, &amp;statbuf) =3D=3D=\r
246  -1)<br>\r
247 &gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue;<br>\r
248 &gt; +<br>\r
249 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0/* We only want to descend into directories=\r
250 .<br>\r
251 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 * But symlinks can be to directories too, =\r
252 of course.<br>\r
253 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 *<br>\r
254 &gt; @@ -328,9 +336,8 @@ add_files_recursive (notmuch_database_t *notmuch,<=\r
255 br>\r
256 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 * scandir results, then it might be a dire=\r
257 ctory (and if not,<br>\r
258 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 * then we&#39;ll stat and return immediate=\r
259 ly in the next level of<br>\r
260 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 * recursion). */<br>\r
261 &gt; - =C2=A0 =C2=A0 =C2=A0 if (entry-&gt;d_type !=3D DT_DIR &amp;&amp;<br>\r
262 &gt; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 entry-&gt;d_type !=3D DT_LNK &amp=\r
263 ;&amp;<br>\r
264 &gt; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 entry-&gt;d_type !=3D DT_UNKNOWN)=\r
265 <br>\r
266 &gt; + =C2=A0 =C2=A0 =C2=A0 if (!(statbuf.st_mode &amp; S_IFDIR) &amp;&amp;=\r
267 <br>\r
268 &gt; + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 !(statbuf.st_mode &amp; S_IFLNK))=\r
269 <br>\r
270 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>\r
271 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>\r
272 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>\r
273 &gt; @@ -427,7 +434,7 @@ add_files_recursive (notmuch_database_t *notmuch,<=\r
274 br>\r
275 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 *<br>\r
276 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 * In either case, a stat does the trick.<b=\r
277 r>\r
278 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 */<br>\r
279 &gt; - =C2=A0 =C2=A0 =C2=A0 if (entry-&gt;d_type =3D=3D DT_LNK || entry-&gt=\r
280 ;d_type =3D=3D DT_UNKNOWN) {<br>\r
281 &gt; + =C2=A0 =C2=A0 =C2=A0 if (stat(entry-&gt;d_name, &amp;statbuf) =3D=3D=\r
282  -1 || statbuf.st_mode &amp; S_IFLNK) {<br>\r
283 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int err;<br>\r
284 &gt;<br>\r
285 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0next =3D talloc_asprintf (not=\r
286 much, &quot;%s/%s&quot;, path, entry-&gt;d_name);<br>\r
287 &gt; @@ -443,7 +450,7 @@ add_files_recursive (notmuch_database_t *notmuch,<=\r
288 br>\r
289 &gt;<br>\r
290 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (! S_ISREG (st.st_mode))<b=\r
291 r>\r
292 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>\r
293 &gt; - =C2=A0 =C2=A0 =C2=A0 } else if (entry-&gt;d_type !=3D DT_REG) {<br>\r
294 &gt; + =C2=A0 =C2=A0 =C2=A0 } else if ( statbuf.st_mode &amp; S_IFREG) {<br=\r
295 >\r
296 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>\r
297 &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>\r
298 &gt;<br>\r
299 &gt; --<br>\r
300 &gt; 1.7.3.2<br>\r
301 &gt;<br>\r
302 &gt; _______________________________________________<br>\r
303 &gt; notmuch mailing list<br>\r
304 &gt; <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a>=\r
305 <br>\r
306 &gt; <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http://not=\r
307 muchmail.org/mailman/listinfo/notmuch</a><br>\r
308 </p>\r
309 \r
310 --047d7b2e09bd66b3a104bd3d2610--\r