[Patch v6 5/7] CLI: add notmuch-config support for named queries
[notmuch-archives.git] / f8 / b5287c022e0992bee4a3afad22ac6d1b0567e0
1 Return-Path: <bremner@tethera.net>\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 arlo.cworth.org (Postfix) with ESMTP id 3801D6DE02C2\r
6  for <notmuch@notmuchmail.org>; Wed,  6 Apr 2016 03:27:37 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.02\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
12   SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id JFcQty5MZ2gK for <notmuch@notmuchmail.org>;\r
16  Wed,  6 Apr 2016 03:27:29 -0700 (PDT)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id C11CB6DE02C9\r
19  for <notmuch@notmuchmail.org>; Wed,  6 Apr 2016 03:27:21 -0700 (PDT)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <bremner@tethera.net>)\r
22  id 1ankgl-00033f-38; Wed, 06 Apr 2016 06:27:55 -0400\r
23 Received: (nullmailer pid 28738 invoked by uid 1000);\r
24  Wed, 06 Apr 2016 10:27:16 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
27 Subject: [PATCH 1/3] test: improve error handling in lib-error tests\r
28 Date: Wed,  6 Apr 2016 07:27:09 -0300\r
29 Message-Id: <1459938431-28670-2-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.8.0.rc3\r
31 In-Reply-To: <1459938431-28670-1-git-send-email-david@tethera.net>\r
32 References: <1459855082-5715-2-git-send-email-david@tethera.net>\r
33  <1459938431-28670-1-git-send-email-david@tethera.net>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.20\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38  <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
40  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Wed, 06 Apr 2016 10:27:37 -0000\r
47 \r
48 There is at least one bug fixed here (missing parameter to printf), even\r
49 if exiting via segfault is considered OK.\r
50 ---\r
51  test/T560-lib-error.sh | 12 ++++++++----\r
52  1 file changed, 8 insertions(+), 4 deletions(-)\r
53 \r
54 diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh\r
55 index 59a479c..49d3674 100755\r
56 --- a/test/T560-lib-error.sh\r
57 +++ b/test/T560-lib-error.sh\r
58 @@ -202,16 +202,20 @@ int main (int argc, char** argv)\r
59     notmuch_database_t *db;\r
60     notmuch_status_t stat;\r
61     char *path;\r
62 +   char *msg = NULL;\r
63     int fd;\r
64  \r
65 -   stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db);\r
66 +   stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg);\r
67     if (stat != NOTMUCH_STATUS_SUCCESS) {\r
68 -     fprintf (stderr, "error opening database: %d\n", stat);\r
69 +     fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : "");\r
70 +     exit (1);\r
71     }\r
72     path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]);\r
73     fd = open(path,O_WRONLY|O_TRUNC);\r
74 -   if (fd < 0)\r
75 -       fprintf (stderr, "error opening %s\n");\r
76 +   if (fd < 0) {\r
77 +       fprintf (stderr, "error opening %s\n", argv[1]);\r
78 +       exit (1);\r
79 +   }\r
80  EOF\r
81  cat <<'EOF' > c_tail\r
82     if (stat) {\r
83 -- \r
84 2.8.0.rc3\r
85 \r