From: Jani Nikula Date: Fri, 1 Nov 2013 14:27:13 +0000 (+0100) Subject: [PATCH 4/6] cli: return error status if compaction fails X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4dcdb0b5a78f22be871b6499e81a71b08aada04f;p=notmuch-archives.git [PATCH 4/6] cli: return error status if compaction fails --- diff --git a/54/edc6b42520654fd13ab4ad87b050241b75c71e b/54/edc6b42520654fd13ab4ad87b050241b75c71e new file mode 100644 index 000000000..97489a686 --- /dev/null +++ b/54/edc6b42520654fd13ab4ad87b050241b75c71e @@ -0,0 +1,107 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 3C260431FC2 + for ; Fri, 1 Nov 2013 07:27:52 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id rGdK-OhOsMFk for ; + Fri, 1 Nov 2013 07:27:47 -0700 (PDT) +Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com + [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8CFA6431FD5 + for ; Fri, 1 Nov 2013 07:27:42 -0700 (PDT) +Received: by mail-wi0-f181.google.com with SMTP id ex4so1149710wid.14 + for ; Fri, 01 Nov 2013 07:27:41 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:in-reply-to:references; + bh=m2qSM9sjvoxtu03gctgLFc6H29ot9OEoRAH9vrQPghY=; + b=TqSnlBlHrjl8r6UIoxYhgPUYsnC4lTKTtc3BRf9KD4/pmfEEOs+TegrLauAEaUvLnm + jgMRsbuOVXUKIvuPHZmBzS2GJ593/Vx9CQ+P8l09F5gnaBOI6Ord+alk2BqD+zf3g6ym + YSPQZJXaRjGlVXCdCWBhPhZwWDflP+JtsjjYsQYckl/sxwSZmiBPlt5WOKtFyaQ3HKqh + cdWPTvEEI7PaZKLj3pp7GeA8agkmT9+aT+8ucpjD2VR42bTBONSwaZSlLrTOYLOp78d1 + cNLjuOztNIHc+5OBQk8XRtP2tatTimC1XaBFGH+3fKgFWdtDMf5dGb7P/lpz4TnkUEcx + hgkQ== +X-Gm-Message-State: + ALoCoQmNFK7j9pxKHtn2GsQATDMXwWVF7PsFnCz+BWh9fUHSJjRtcVYXGD2D0OGIKuw/FOrTRTbC +X-Received: by 10.194.23.8 with SMTP id i8mr121731wjf.68.1383316061467; + Fri, 01 Nov 2013 07:27:41 -0700 (PDT) +Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) + by mx.google.com with ESMTPSA id ev4sm6974522wib.7.2013.11.01.07.27.40 + for + (version=TLSv1.1 cipher=RC4-SHA bits=128/128); + Fri, 01 Nov 2013 07:27:40 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 4/6] cli: return error status if compaction fails +Date: Fri, 1 Nov 2013 15:27:13 +0100 +Message-Id: + <8448d3b3daaca43859c984f5623f279d4510288a.1383315568.git.jani@nikula.org> +X-Mailer: git-send-email 1.7.2.5 +In-Reply-To: +References: +In-Reply-To: +References: +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 01 Nov 2013 14:27:52 -0000 + +--- + notmuch-compact.c | 19 ++++++++++--------- + 1 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/notmuch-compact.c b/notmuch-compact.c +index 043710f..2afa725 100644 +--- a/notmuch-compact.c ++++ b/notmuch-compact.c +@@ -39,16 +39,17 @@ notmuch_compact_command (notmuch_config_t *config, + ret = notmuch_database_compact (path, backup_path, status_update_cb, NULL); + if (ret) { + fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string(ret)); +- } else { +- printf ("\n"); +- printf ("\n"); +- printf ("The old database has been moved to %s", backup_path); +- printf ("\n"); +- printf ("To delete run,\n"); +- printf ("\n"); +- printf (" rm -R %s\n", backup_path); +- printf ("\n"); ++ return 1; + } + ++ printf ("\n"); ++ printf ("\n"); ++ printf ("The old database has been moved to %s", backup_path); ++ printf ("\n"); ++ printf ("To delete run,\n"); ++ printf ("\n"); ++ printf (" rm -R %s\n", backup_path); ++ printf ("\n"); ++ + return 0; + } +-- +1.7.2.5 +