database error
[notmuch-archives.git] / e8 / 273f11bd941392efae6f28f6c4ba65a17110e4
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 2C7CB431FDB\r
6         for <notmuch@notmuchmail.org>; Thu, 24 May 2012 14:09:01 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[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 OWP8UL8fsM8Y for <notmuch@notmuchmail.org>;\r
16         Thu, 24 May 2012 14:09:00 -0700 (PDT)\r
17 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
18         [209.85.215.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 5C23F431FBD\r
21         for <notmuch@notmuchmail.org>; Thu, 24 May 2012 14:09:00 -0700 (PDT)\r
22 Received: by lagu2 with SMTP id u2so180288lag.26\r
23         for <notmuch@notmuchmail.org>; Thu, 24 May 2012 14:08:58 -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=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:x-gm-message-state;\r
28         bh=QWGkLaCJcx6tAYGKXDWNczs6wqW6D9oiErUOjt47wyY=;\r
29         b=V+dVYbBRruEmHKV8CFKwTVL4rRNafwBRlwOFp29n3ymluVBpM3P/eoO3Z2rMNwqmTz\r
30         aJOqkE8zs+mucX1iJo0XdJUMnoJj6VGspebVg2ECufwiHcLhKcxLOX+T1Bhs76gRecbY\r
31         LU8imchtKcielLST6eeRKBtXVi1iIQtch8d+xTzJFSNgeCdiri2ukVx3ZulteJ1UHe7X\r
32         SFLlm8Vg8yVYwkIxDTN+WA1e+D5592fnPih0jG/r8O2O7m55nhS7R2VqH+BzaOiwAuyc\r
33         ZKg2LC0AcFJaB03MDVYPiyKxvLgqB0VnbOHX8teimRFcMbOtQtWbJRNc19u0/mFPgo1A\r
34         TuKQ==\r
35 Received: by 10.112.40.36 with SMTP id u4mr390266lbk.70.1337893738716;\r
36         Thu, 24 May 2012 14:08:58 -0700 (PDT)\r
37 Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
38         [80.220.80.68])\r
39         by mx.google.com with ESMTPS id k4sm1888807lbb.12.2012.05.24.14.08.56\r
40         (version=SSLv3 cipher=OTHER); Thu, 24 May 2012 14:08:57 -0700 (PDT)\r
41 From: Jani Nikula <jani@nikula.org>\r
42 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
43 Subject: Re: [PATCH v3 3/4] new: Merge error checks from add_files and\r
44         add_files_recursive\r
45 In-Reply-To: <87vcjl5mba.fsf@nikula.org>\r
46 References: <1336429240-1114-1-git-send-email-amdragon@mit.edu>\r
47         <1337887922-13163-1-git-send-email-amdragon@mit.edu>\r
48         <1337887922-13163-4-git-send-email-amdragon@mit.edu>\r
49         <87vcjl5mba.fsf@nikula.org>\r
50 User-Agent: Notmuch/0.13+13~gc259b9a (http://notmuchmail.org) Emacs/23.3.1\r
51         (i686-pc-linux-gnu)\r
52 Date: Fri, 25 May 2012 00:08:55 +0300\r
53 Message-ID: <87sjep5lso.fsf@nikula.org>\r
54 MIME-Version: 1.0\r
55 Content-Type: text/plain; charset=us-ascii\r
56 X-Gm-Message-State:\r
57  ALoCoQknAn49lUPiNRjduXdvlOTD3UOUGDakMwsINEak1XOHMGUpCMUMKMvCge7PVsWKRRxUVwS1\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Thu, 24 May 2012 21:09:01 -0000\r
71 \r
72 \r
73 Grrh, sorry for the spam. My favourite MUA told me:\r
74 \r
75 "Sending...failed to WARNING: gnome-keyring:: couldn't connect to:\r
76 /tmp/keyring-Ky8i5h/pkcs11: No such file or directory"\r
77 \r
78 but sent the message anyway. Apparently msmpt tries to chat with the\r
79 gnome-keyring-daemon even though that should not happen per the man\r
80 page, and would be unnecessary and useless anyway.\r
81 \r
82 J.\r
83 \r
84 \r
85 On Thu, 24 May 2012, Jani Nikula <jani@nikula.org> wrote:\r
86 > On Thu, 24 May 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
87 >> Before XXX, add_files_recursive could have been called on a symlink to\r
88 >> a non-directory.  Hence, calling it on a non-directory was not an\r
89 >> error, so a separate function, add_files, existed to fail loudly in\r
90 >> situations where the path had to be a directory.\r
91 >\r
92 > "Before XXX"?\r
93 >\r
94 > Otherwise, this 3/4 and following 4/4 patch LGTM. I didn't bother\r
95 > looking at 1/4 and 2/4 again, as you say there were no changes.\r
96 >\r
97 >\r
98 > BR,\r
99 > Jani.\r
100 >\r
101 >\r
102 >>\r
103 >> With the new stat-ing logic, add_files_recursive is always called on\r
104 >> directories, so the separation of this logic is no longer necessary.\r
105 >> Hence, this patch moves the strict error checking previously done by\r
106 >> add_files into add_files_recursive.\r
107 >> ---\r
108 >>  notmuch-new.c |   27 +++++----------------------\r
109 >>  1 file changed, 5 insertions(+), 22 deletions(-)\r
110 >>\r
111 >> diff --git a/notmuch-new.c b/notmuch-new.c\r
112 >> index c64f1a7..2b05605 100644\r
113 >> --- a/notmuch-new.c\r
114 >> +++ b/notmuch-new.c\r
115 >> @@ -308,11 +308,10 @@ add_files_recursive (notmuch_database_t *notmuch,\r
116 >>      }\r
117 >>      stat_time = time (NULL);\r
118 >>  \r
119 >> -    /* This is not an error since we may have recursed based on a\r
120 >> -     * symlink to a regular file, not a directory, and we don't know\r
121 >> -     * that until this stat. */\r
122 >> -    if (! S_ISDIR (st.st_mode))\r
123 >> -    return NOTMUCH_STATUS_SUCCESS;\r
124 >> +    if (! S_ISDIR (st.st_mode)) {\r
125 >> +    fprintf (stderr, "Error: %s is not a directory.\n", path);\r
126 >> +    return NOTMUCH_STATUS_FILE_ERROR;\r
127 >> +    }\r
128 >>  \r
129 >>      fs_mtime = st.st_mtime;\r
130 >>  \r
131 >> @@ -655,23 +654,7 @@ add_files (notmuch_database_t *notmuch,\r
132 >>         const char *path,\r
133 >>         add_files_state_t *state)\r
134 >>  {\r
135 >> -    notmuch_status_t status;\r
136 >> -    struct stat st;\r
137 >> -\r
138 >> -    if (stat (path, &st)) {\r
139 >> -    fprintf (stderr, "Error reading directory %s: %s\n",\r
140 >> -             path, strerror (errno));\r
141 >> -    return NOTMUCH_STATUS_FILE_ERROR;\r
142 >> -    }\r
143 >> -\r
144 >> -    if (! S_ISDIR (st.st_mode)) {\r
145 >> -    fprintf (stderr, "Error: %s is not a directory.\n", path);\r
146 >> -    return NOTMUCH_STATUS_FILE_ERROR;\r
147 >> -    }\r
148 >> -\r
149 >> -    status = add_files_recursive (notmuch, path, state);\r
150 >> -\r
151 >> -    return status;\r
152 >> +    return add_files_recursive (notmuch, path, state);\r
153 >>  }\r
154 >>  \r
155 >>  /* XXX: This should be merged with the add_files function since it\r
156 >> -- \r
157 >> 1.7.10\r
158 >>\r
159 >> _______________________________________________\r
160 >> notmuch mailing list\r
161 >> notmuch@notmuchmail.org\r
162 >> http://notmuchmail.org/mailman/listinfo/notmuch\r