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 3BCD2429E5D for ; Sun, 27 Oct 2013 13:30:26 -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 5oBM7J4SRS1A for ; Sun, 27 Oct 2013 13:30:19 -0700 (PDT) Received: from mail-qe0-f48.google.com (mail-qe0-f48.google.com [209.85.128.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D8C37429E38 for ; Sun, 27 Oct 2013 13:30:19 -0700 (PDT) Received: by mail-qe0-f48.google.com with SMTP id d4so3579920qej.35 for ; Sun, 27 Oct 2013 13:30:19 -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=jq8lOOErg+iq/0R86inkbqUue+z82pSSJu0UFpGmMu8=; b=q1p9XkQfic7wIVlgN/1SMdcajHq35I2QemwjW2nkGPYl6TUsxnNN1gKtw3zV+5wg/r rAJ99uMqW0zmBUaZvSuJ/g/fjvEhPRQtUvRhM4pFFNMRrh0XUZNyMQaon/cOprU7hgcF 8pHBpPOn4TfshKGJFtQ8GVtS9DjJ39ksAnSA4dD2L1GdIAvcVnOGW65+za4Ep9XiNVcF FgMv00IfWSQKgWKcLwng+Z9Bx6ADAQPiqsLa4ZdkKMrlVEQ8uerPLYKzX2rI8Tzen1Ke J0kSDbhYO0tyY93C+Yf+zTdQ07fKXAMriteDlh4gpcrtcbuwz6EdVt8FySYVh6Q/ok3D Zofg== X-Received: by 10.49.51.170 with SMTP id l10mr24742541qeo.46.1382905819437; Sun, 27 Oct 2013 13:30:19 -0700 (PDT) Received: from localhost.localdomain (pool-96-240-254-51.spfdma.east.verizon.net. [96.240.254.51]) by mx.google.com with ESMTPSA id x1sm45270525qai.6.2013.10.27.13.30.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Oct 2013 13:30:19 -0700 (PDT) From: Ben Gamari To: notmuch@notmuchmail.org Subject: [PATCH 3/3] compact: Provide user with more error feedback Date: Sun, 27 Oct 2013 16:30:07 -0400 Message-Id: <1382905807-22220-3-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1382905807-22220-1-git-send-email-bgamari.foss@gmail.com> References: <1382905807-22220-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: Sun, 27 Oct 2013 20:30: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.3.2