From: Ben Gamari Date: Tue, 15 Oct 2013 01:13:05 +0000 (+2000) Subject: [PATCH 3/3] compact: Provide user with more error feedback X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=37ecc53fdd034567532cae484d768541c8f9163f;p=notmuch-archives.git [PATCH 3/3] compact: Provide user with more error feedback --- diff --git a/ac/cd8a0a63c6dd6ce7c9abbe3859993a4891db5f b/ac/cd8a0a63c6dd6ce7c9abbe3859993a4891db5f new file mode 100644 index 000000000..dbfe61f10 --- /dev/null +++ b/ac/cd8a0a63c6dd6ce7c9abbe3859993a4891db5f @@ -0,0 +1,103 @@ +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 AAD27431FB6 + for ; Mon, 14 Oct 2013 18:13:25 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, 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 PFnhoxUrcXyL for ; + Mon, 14 Oct 2013 18:13:19 -0700 (PDT) +Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com + [209.85.216.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 40808431FBC + for ; Mon, 14 Oct 2013 18:13:15 -0700 (PDT) +Received: by mail-qa0-f47.google.com with SMTP id k15so2734854qaq.20 + for ; Mon, 14 Oct 2013 18:13:13 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=IsbVoZWV/iJTZET2+vfs0WqvzmI7pzc5BhPNPZqMIwE=; + b=0GPfcyo3lhWuA/mYaWJZEdIEEh+zQrZK03GJJRaET5WKC4NRRkeiZishpYNCL4J+31 + nc4z7wxJeVHwkZdIbM44lnubiJEo1bUdS+1iI2/V2LLrlGKOSJjgc8u/Gl19+4yfUXWm + scKW4kmFW8hc2bTG6roOopPQe23mypU8etYh36Ak1vJcdaIebVDizDmjUscOMAvPBtak + fyBwzu6/oMpvmdWuSyRKV3s3od5KTm62z/Mxf5+M2KBOMDYCCXiEcaN5zvN+j6fUcJb6 + vpC5pVn8Xy7YGtrmSx2mxyYQzPETj6G7qA3cQ52C2+ZtCOhq0Zy/RbzEEqpX5BnTW50m + VqTg== +X-Received: by 10.224.126.197 with SMTP id d5mr39129880qas.1.1381799593665; + Mon, 14 Oct 2013 18:13:13 -0700 (PDT) +Received: from localhost.localdomain + (pool-108-8-224-250.spfdma.east.verizon.net. [108.8.224.250]) + by mx.google.com with ESMTPSA id + og1sm105736333qeb.3.1969.12.31.16.00.00 + (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); + Mon, 14 Oct 2013 18:13:13 -0700 (PDT) +From: Ben Gamari +To: notmuch@notmuchmail.org +Subject: [PATCH 3/3] compact: Provide user with more error feedback +Date: Mon, 14 Oct 2013 21:13:05 -0400 +Message-Id: <1381799585-16274-4-git-send-email-bgamari.foss@gmail.com> +X-Mailer: git-send-email 1.8.1.2 +In-Reply-To: <1381799585-16274-1-git-send-email-bgamari.foss@gmail.com> +References: <1381799585-16274-1-git-send-email-bgamari.foss@gmail.com> +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: Tue, 15 Oct 2013 01:13:26 -0000 + +Provide instructions on what to do when we couldn't move the compacted +database into place. + +Signed-off-by: Ben Gamari +--- + lib/database.cc | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/lib/database.cc b/lib/database.cc +index 57c2292..6f9fed1 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -938,7 +938,23 @@ notmuch_database_compact (const char* path, + } + + if (rename(compact_xapian_path, xapian_path)) { +- fprintf (stderr, "Error moving compacted database\n"); ++ fprintf (stderr, "Error moving compacted database into place: %s\n", strerror(errno)); ++ fprintf (stderr, "\n"); ++ fprintf (stderr, "Encountered error %s while moving the compacted database,\n", ++ strerror(errno)); ++ fprintf (stderr, "\n"); ++ fprintf (stderr, " %s\n", compact_xapian_path); ++ fprintf (stderr, "\n"); ++ fprintf (stderr, "to\n"); ++ fprintf (stderr, "\n"); ++ fprintf (stderr, " %s\n", xapian_path); ++ fprintf (stderr, "\n"); ++ fprintf (stderr, "Please identify the reason for this and move the compacted database into place manually.\n"); ++ if (backup_path != NULL) { ++ fprintf (stderr, "Otherwise, you can revert to the backup database located at,\n"); ++ fprintf (stderr, "\n"); ++ fprintf (stderr, " %s\n", backup_path); ++ } + ret = NOTMUCH_STATUS_FILE_ERROR; + goto DONE; + } +-- +1.8.1.2 +