Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 31 / 84d150acd0370dff125b5375a96625494f7166
1 Return-Path: <too@guru-group.fi>\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 6F5CB431E84\r
6         for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 14:03:43 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 QYdAtEpnszOv for <notmuch@notmuchmail.org>;\r
16         Thu, 14 Nov 2013 14:03:36 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id ABF09431E62\r
19         for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 14:03:36 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 422CD1000E5; Fri, 15 Nov 2013 00:03:32 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH 5/5] compact: improve error messages on failures after\r
25         compaction\r
26 Date: Fri, 15 Nov 2013 00:03:27 +0200\r
27 Message-Id: <1384466607-28298-3-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 In-Reply-To: <1384466607-28298-1-git-send-email-tomi.ollila@iki.fi>\r
30 References: <id:1384362167-12740-1-git-send-email-tomi.ollila@iki.fi>\r
31         <1384466607-28298-1-git-send-email-tomi.ollila@iki.fi>\r
32 Cc: tomi.ollila@iki.fi\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Thu, 14 Nov 2013 22:03:43 -0000\r
46 \r
47 The error messages written during the steps replacing old\r
48 database with new now includes relevant paths and strerror.\r
49 ---\r
50  lib/database.cc | 16 ++++++++++++----\r
51  1 file changed, 12 insertions(+), 4 deletions(-)\r
52 \r
53 diff --git a/lib/database.cc b/lib/database.cc\r
54 index d09ad99..f395061 100644\r
55 --- a/lib/database.cc\r
56 +++ b/lib/database.cc\r
57 @@ -942,19 +942,27 @@ notmuch_database_compact (const char *path,\r
58      }\r
59  \r
60      if (rename (xapian_path, backup_path)) {\r
61 -       fprintf (stderr, "Error moving old database out of the way\n");\r
62 +       fprintf (stderr, "Error moving %s to %s: %s\n",\r
63 +                xapian_path, backup_path, strerror (errno));\r
64         ret = NOTMUCH_STATUS_FILE_ERROR;\r
65         goto DONE;\r
66      }\r
67  \r
68      if (rename (compact_xapian_path, xapian_path)) {\r
69 -       fprintf (stderr, "Error moving compacted database\n");\r
70 +       fprintf (stderr, "Error moving %s to %s: %s\n",\r
71 +                compact_xapian_path, xapian_path, strerror (errno));\r
72         ret = NOTMUCH_STATUS_FILE_ERROR;\r
73         goto DONE;\r
74      }\r
75  \r
76 -    if (! keep_backup)\r
77 -       rmtree (backup_path);\r
78 +    if (! keep_backup) {\r
79 +       if (rmtree (backup_path)) {\r
80 +           fprintf (stderr, "Error removing old database %s: %s\n",\r
81 +                    backup_path, strerror (errno));\r
82 +           ret = NOTMUCH_STATUS_FILE_ERROR;\r
83 +           goto DONE;\r
84 +       }\r
85 +    }\r
86  \r
87    DONE:\r
88      if (notmuch)\r
89 -- \r
90 1.8.0\r
91 \r