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 33DA7431FD2 for ; Mon, 1 Sep 2014 15:49:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 7swONAzt6tqZ for ; Mon, 1 Sep 2014 15:49:16 -0700 (PDT) Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu [18.7.68.36]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7ACE4431FCB for ; Mon, 1 Sep 2014 15:49:16 -0700 (PDT) X-AuditID: 12074424-f79346d000004923-04-5404f7eac4f0 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 6D.80.18723.AE7F4045; Mon, 1 Sep 2014 18:49:14 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s81MnDHZ003884; Mon, 1 Sep 2014 18:49:13 -0400 Received: from drake.dyndns.org (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [216.15.114.40]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s81MnAtd005214 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 1 Sep 2014 18:49:12 -0400 Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1XOaPO-0008N1-QM; Mon, 01 Sep 2014 18:49:10 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH] lib: Fix endless upgrade problem Date: Mon, 1 Sep 2014 18:49:07 -0400 Message-Id: <1409611747-32141-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 2.0.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsUixG6nrvvqO0uIwbHDahY3WrsZLa7fnMns wOTxbNUtZo8th94zBzBFcdmkpOZklqUW6dslcGXsnbiUreAvR8XZe+dYGhi3sncxcnJICJhI vH7ynQXCFpO4cG89WxcjF4eQwGwmianf3oAlhAQ2MEp8+8wBYd9mkjh6rAyiaC6jROuOHrBJ bAIaEr9vLWYCsUUEpCV23p3NCmIzC1hKXP3aDhYXFjCU2HXsNVicRUBVYlnvZbA4r4CDxOVl P1ghrpCTaLjxiW0CI+8CRoZVjLIpuVW6uYmZOcWpybrFyYl5ealFuuZ6uZkleqkppZsYwYHh orKDsfmQ0iFGAQ5GJR7eB7OYQ4RYE8uKK3MPMUpyMCmJ8op8YwkR4kvKT6nMSCzOiC8qzUkt PsQowcGsJMLrdRkox5uSWFmVWpQPk5LmYFES531rbRUsJJCeWJKanZpakFoEk5Xh4FCS4H0O MlSwKDU9tSItM6cEIc3EwQkynAdo+HeQGt7igsTc4sx0iPwpRl2OdZ3f+pmEWPLy81KlxHkf gRQJgBRllObBzYFF9CtGcaC3hHmfglTxAJMB3KRXQEuYgJZUVDGCLClJREhJNTCqr3Of6rW3 scB+1YIbZXwN/elMP5YGNWecfhGj9z1dZc6ioJMXhSJ/RjAES9usjt45a80+la1f+vrjGl+F 6PLfK59ZkFJ3nWly59lKv+75Ap3nBNhYs65PSHq9sSCoQKo8PlSknFsp1jO0ge0cu9iUlPlX Z3vumZDu8+rEjG7t32mc7y0i5JVYijMSDbWYi4oTAQvQkOvDAgAA 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: Mon, 01 Sep 2014 22:49:20 -0000 48db8c8 introduced a disagreement between when notmuch_database_needs_upgrade returned TRUE and when notmuch_database_upgrade actually performed an upgrade. As a result, if a database had a version less than 3, but no new features were required, notmuch new would call notmuch_database_upgrade to perform an upgrade, but notmuch_database_upgrade would return immediately without updating the database version. Hence, the next notmuch new would do the same, and so on. Fix this by ensuring that the upgrade-required logic is identical between the two. --- lib/database.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/database.cc b/lib/database.cc index 5116188..a3a7cd3 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, target_features = notmuch->features | NOTMUCH_FEATURES_CURRENT; new_features = NOTMUCH_FEATURES_CURRENT & ~notmuch->features; - if (! new_features) + if (! notmuch_database_needs_upgrade (notmuch)) return NOTMUCH_STATUS_SUCCESS; if (progress_notify) { -- 2.0.0