From: Jani Nikula Date: Sun, 3 Nov 2013 12:24:48 +0000 (+0200) Subject: [PATCH v2 08/11] cli: return error status if compaction fails X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9a422abd6e9292e347167f18146b4e70040aff81;p=notmuch-archives.git [PATCH v2 08/11] cli: return error status if compaction fails --- diff --git a/c3/b7c251abf9145349c3effa73314a4e13e05862 b/c3/b7c251abf9145349c3effa73314a4e13e05862 new file mode 100644 index 000000000..7a25bf63f --- /dev/null +++ b/c3/b7c251abf9145349c3effa73314a4e13e05862 @@ -0,0 +1,109 @@ +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 1DACC431FCB + for ; Sun, 3 Nov 2013 04:25:49 -0800 (PST) +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 JJWFDKmXd8Uj for ; + Sun, 3 Nov 2013 04:25:42 -0800 (PST) +Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com + [74.125.83.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 11D92429E39 for ; Sun, 3 Nov 2013 04:25:15 -0800 + (PST) +Received: by mail-ee0-f49.google.com with SMTP id e52so577701eek.22 + for ; Sun, 03 Nov 2013 04:25:14 -0800 (PST) +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=uvppT5gjiULeS+rtIXFQc9/UaUBvqAaXg+Y2xkiUH4M=; + b=ZPW2i/+UazM3SLvvluGSdD0grcmHWXOhdyjdZsnIshzH3NQqT3IMUmz2YwX3SbRqSj + Pk7jyHVGmBQPXracBqRkEo9Oy1ulHb8spnOkAJh/Yen7F96KjA/5DXMdVHvtK9/5csDq + LK5rtNXVC57QeFBE5lfx9J7TMl1axy5sj9EiIEpmFNOalNw76cT6GiJKcQCyLPnps5DJ + BY4kbY+M/SEqC/Heyrg2WmV7D3kcPlaXz4PAFn1cGWRffvaabGynmjavDX0z6rnURZ+3 + vMfeZF3j4c2nx3nR39TTr7FO91OFFG38k8SYKeXEl4K+YvLVnuy//whcVlAJXE/0aUJG + mwuQ== +X-Gm-Message-State: + ALoCoQmtRm7AbN5v/pMjPKAjjKeAfwc62dmtEG8L7hqF3/QOh7pb10oSW4WZUB6QGRiN9EDS+bP7 +X-Received: by 10.15.74.197 with SMTP id j45mr2289244eey.40.1383481514911; + Sun, 03 Nov 2013 04:25:14 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id 8sm1249322eem.15.2013.11.03.04.25.13 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 03 Nov 2013 04:25:14 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2 08/11] cli: return error status if compaction fails +Date: Sun, 3 Nov 2013 14:24:48 +0200 +Message-Id: + <4424dd938a50a031b36c439db129eebbe8366484.1383481295.git.jani@nikula.org> +X-Mailer: git-send-email 1.8.4.rc3 +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: Sun, 03 Nov 2013 12:25:49 -0000 + +As is customary for any tool. +--- + notmuch-compact.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +diff --git a/notmuch-compact.c b/notmuch-compact.c +index 55dc731..b9461c2 100644 +--- a/notmuch-compact.c ++++ b/notmuch-compact.c +@@ -43,16 +43,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.8.4.rc3 +