[PATCH v2 08/11] cli: return error status if compaction fails
authorJani Nikula <jani@nikula.org>
Sun, 3 Nov 2013 12:24:48 +0000 (14:24 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:58 +0000 (09:57 -0800)
c3/b7c251abf9145349c3effa73314a4e13e05862 [new file with mode: 0644]

diff --git a/c3/b7c251abf9145349c3effa73314a4e13e05862 b/c3/b7c251abf9145349c3effa73314a4e13e05862
new file mode 100644 (file)
index 0000000..7a25bf6
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1DACC431FCB\r
+       for <notmuch@notmuchmail.org>; Sun,  3 Nov 2013 04:25:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id JJWFDKmXd8Uj for <notmuch@notmuchmail.org>;\r
+       Sun,  3 Nov 2013 04:25:42 -0800 (PST)\r
+Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com\r
+ [74.125.83.49])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 11D92429E39   for <notmuch@notmuchmail.org>; Sun,  3 Nov 2013 04:25:15 -0800\r
+ (PST)\r
+Received: by mail-ee0-f49.google.com with SMTP id e52so577701eek.22\r
+       for <notmuch@notmuchmail.org>; Sun, 03 Nov 2013 04:25:14 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references:in-reply-to:references;\r
+       bh=uvppT5gjiULeS+rtIXFQc9/UaUBvqAaXg+Y2xkiUH4M=;\r
+       b=ZPW2i/+UazM3SLvvluGSdD0grcmHWXOhdyjdZsnIshzH3NQqT3IMUmz2YwX3SbRqSj\r
+       Pk7jyHVGmBQPXracBqRkEo9Oy1ulHb8spnOkAJh/Yen7F96KjA/5DXMdVHvtK9/5csDq\r
+       LK5rtNXVC57QeFBE5lfx9J7TMl1axy5sj9EiIEpmFNOalNw76cT6GiJKcQCyLPnps5DJ\r
+       BY4kbY+M/SEqC/Heyrg2WmV7D3kcPlaXz4PAFn1cGWRffvaabGynmjavDX0z6rnURZ+3\r
+       vMfeZF3j4c2nx3nR39TTr7FO91OFFG38k8SYKeXEl4K+YvLVnuy//whcVlAJXE/0aUJG\r
+       mwuQ==\r
+X-Gm-Message-State:\r
+ ALoCoQmtRm7AbN5v/pMjPKAjjKeAfwc62dmtEG8L7hqF3/QOh7pb10oSW4WZUB6QGRiN9EDS+bP7\r
+X-Received: by 10.15.74.197 with SMTP id j45mr2289244eey.40.1383481514911;\r
+       Sun, 03 Nov 2013 04:25:14 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id 8sm1249322eem.15.2013.11.03.04.25.13\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 03 Nov 2013 04:25:14 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 08/11] cli: return error status if compaction fails\r
+Date: Sun,  3 Nov 2013 14:24:48 +0200\r
+Message-Id:\r
+ <4424dd938a50a031b36c439db129eebbe8366484.1383481295.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.4.rc3\r
+In-Reply-To: <cover.1383481295.git.jani@nikula.org>\r
+References: <cover.1383481295.git.jani@nikula.org>\r
+In-Reply-To: <cover.1383481295.git.jani@nikula.org>\r
+References: <cover.1383481295.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 03 Nov 2013 12:25:49 -0000\r
+\r
+As is customary for any tool.\r
+---\r
+ notmuch-compact.c | 19 ++++++++++---------\r
+ 1 file changed, 10 insertions(+), 9 deletions(-)\r
+\r
+diff --git a/notmuch-compact.c b/notmuch-compact.c\r
+index 55dc731..b9461c2 100644\r
+--- a/notmuch-compact.c\r
++++ b/notmuch-compact.c\r
+@@ -43,16 +43,17 @@ notmuch_compact_command (notmuch_config_t *config,\r
+     ret = notmuch_database_compact (path, backup_path, status_update_cb, NULL);\r
+     if (ret) {\r
+       fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string(ret));\r
+-    } else {\r
+-      printf ("\n");\r
+-      printf ("\n");\r
+-      printf ("The old database has been moved to %s", backup_path);\r
+-      printf ("\n");\r
+-      printf ("To delete run,\n");\r
+-      printf ("\n");\r
+-      printf ("    rm -R %s\n", backup_path);\r
+-      printf ("\n");\r
++      return 1;\r
+     }\r
\r
++    printf ("\n");\r
++    printf ("\n");\r
++    printf ("The old database has been moved to %s", backup_path);\r
++    printf ("\n");\r
++    printf ("To delete run,\n");\r
++    printf ("\n");\r
++    printf ("    rm -R %s\n", backup_path);\r
++    printf ("\n");\r
++\r
+     return 0;\r
+ }\r
+-- \r
+1.8.4.rc3\r
+\r