[PATCH 4/6] cli: return error status if compaction fails
authorJani Nikula <jani@nikula.org>
Fri, 1 Nov 2013 14:27:13 +0000 (15:27 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:50 +0000 (09:57 -0800)
54/edc6b42520654fd13ab4ad87b050241b75c71e [new file with mode: 0644]

diff --git a/54/edc6b42520654fd13ab4ad87b050241b75c71e b/54/edc6b42520654fd13ab4ad87b050241b75c71e
new file mode 100644 (file)
index 0000000..97489a6
--- /dev/null
@@ -0,0 +1,107 @@
+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 3C260431FC2\r
+       for <notmuch@notmuchmail.org>; Fri,  1 Nov 2013 07:27:52 -0700 (PDT)\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 rGdK-OhOsMFk for <notmuch@notmuchmail.org>;\r
+       Fri,  1 Nov 2013 07:27:47 -0700 (PDT)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8CFA6431FD5\r
+       for <notmuch@notmuchmail.org>; Fri,  1 Nov 2013 07:27:42 -0700 (PDT)\r
+Received: by mail-wi0-f181.google.com with SMTP id ex4so1149710wid.14\r
+       for <notmuch@notmuchmail.org>; Fri, 01 Nov 2013 07:27:41 -0700 (PDT)\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=m2qSM9sjvoxtu03gctgLFc6H29ot9OEoRAH9vrQPghY=;\r
+       b=TqSnlBlHrjl8r6UIoxYhgPUYsnC4lTKTtc3BRf9KD4/pmfEEOs+TegrLauAEaUvLnm\r
+       jgMRsbuOVXUKIvuPHZmBzS2GJ593/Vx9CQ+P8l09F5gnaBOI6Ord+alk2BqD+zf3g6ym\r
+       YSPQZJXaRjGlVXCdCWBhPhZwWDflP+JtsjjYsQYckl/sxwSZmiBPlt5WOKtFyaQ3HKqh\r
+       cdWPTvEEI7PaZKLj3pp7GeA8agkmT9+aT+8ucpjD2VR42bTBONSwaZSlLrTOYLOp78d1\r
+       cNLjuOztNIHc+5OBQk8XRtP2tatTimC1XaBFGH+3fKgFWdtDMf5dGb7P/lpz4TnkUEcx\r
+       hgkQ==\r
+X-Gm-Message-State:\r
+ ALoCoQmNFK7j9pxKHtn2GsQATDMXwWVF7PsFnCz+BWh9fUHSJjRtcVYXGD2D0OGIKuw/FOrTRTbC\r
+X-Received: by 10.194.23.8 with SMTP id i8mr121731wjf.68.1383316061467;\r
+       Fri, 01 Nov 2013 07:27:41 -0700 (PDT)\r
+Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
+       by mx.google.com with ESMTPSA id ev4sm6974522wib.7.2013.11.01.07.27.40\r
+       for <multiple recipients>\r
+       (version=TLSv1.1 cipher=RC4-SHA bits=128/128);\r
+       Fri, 01 Nov 2013 07:27:40 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/6] cli: return error status if compaction fails\r
+Date: Fri,  1 Nov 2013 15:27:13 +0100\r
+Message-Id:\r
+ <8448d3b3daaca43859c984f5623f279d4510288a.1383315568.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.2.5\r
+In-Reply-To: <cover.1383315568.git.jani@nikula.org>\r
+References: <cover.1383315568.git.jani@nikula.org>\r
+In-Reply-To: <cover.1383315568.git.jani@nikula.org>\r
+References: <cover.1383315568.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: Fri, 01 Nov 2013 14:27:52 -0000\r
+\r
+---\r
+ notmuch-compact.c |   19 ++++++++++---------\r
+ 1 files changed, 10 insertions(+), 9 deletions(-)\r
+\r
+diff --git a/notmuch-compact.c b/notmuch-compact.c\r
+index 043710f..2afa725 100644\r
+--- a/notmuch-compact.c\r
++++ b/notmuch-compact.c\r
+@@ -39,16 +39,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.7.2.5\r
+\r