From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 715B7431FAE for ; Thu, 17 May 2012 21:13:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 tdhbEzc0nGX1 for ; Thu, 17 May 2012 21:13:54 -0700 (PDT) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id EB1D5431FD4 for ; Thu, 17 May 2012 21:13:52 -0700 (PDT) X-AuditID: 12074424-b7fae6d000000906-f6-4fb5cc80a3d0 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 44.51.02310.08CC5BF4; Fri, 18 May 2012 00:13:52 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q4I4DpsQ009476 for ; Fri, 18 May 2012 00:13:52 -0400 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q4I4Dn4d026780 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 18 May 2012 00:13:51 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1SVEZZ-0000yp-Io for notmuch@notmuchmail.org; Fri, 18 May 2012 00:13:49 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 0/9] Fix directory lookup on read-only databases Date: Fri, 18 May 2012 00:13:33 -0400 Message-Id: <1337314423-3702-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42IRYrdT1204s9XfYGsDh8X1mzOZHRg9nq26 xRzAGMVlk5Kak1mWWqRvl8CVMa+VpeAoV8WelTPZGhifs3cxcnJICJhIND66ygZhi0lcuLce yObiEBLYxyjx5ckrJgjnHKPEsTfTWCCcv0wSmybdYQRpERLYwShx5bUuiM0moCGxbf9ysLiI gLTEzruzWUFsYQEHibWvJjGB2CwCqhIX3j0Es3kF7CUuX54DdYa8xNP7fWwTGHkWMDKsYpRN ya3SzU3MzClOTdYtTk7My0st0jXXy80s0UtNKd3ECPa2i8oOxuZDSocYBTgYlXh4BeZv9Rdi TSwrrsw9xCjJwaQkyvv9JFCILyk/pTIjsTgjvqg0J7X4EKMEB7OSCK9sN1CONyWxsiq1KB8m Jc3BoiTOq6H1zk9IID2xJDU7NbUgtQgmK8PBoSTBu+k0UKNgUWp6akVaZk4JQpqJgxNkOA/Q 8EyQGt7igsTc4sx0iPwpRkUpcd4ykIQASCKjNA+uFxaNrxjFgV4R5p0AUsUDjGS47ldAg5mA BpflbgIZXJKIkJJqYDTQO3Bnyt9LLz9cfWTtJ3s5YcuclxM9uDwj1PT/Hb62/IJn9qGJRQKc WrkHI2c9Tdj+n7G++IP321zDNzb7JiqoZh54GtQpdGXawfgoP8nNzZ/Pr7PR2cXiwL9I6sol 5pMefjsXGn9uW7DgSNa/V4x8K16ov9y/zMw0wiUkrZWzJ0o2ykpM84wSS3FGoqEWc1FxIgD1 G1kOoQIAAA== 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, 18 May 2012 04:13:55 -0000 This fixes notmuch_database_get_directory and notmuch_database_find_message_by_filename so that they don't attempt to create missing directory documents. This makes them work on read-only databases (and prevents n_d_f_m_b_f from crashing unceremoniously on read-only databases). Unfortunately, there are several functions involved in directory document lookup, so the first three patches simply add a creation flag at each necessary layer. The remaining patches then fix up the two API functions and their uses. If we do a 0.13.1 bug fix release, these patches could go in to complement the API changes made in 0.13 to support these fixes. David can make that call. There are several patches, but they're all short and incremental. bindings/python/notmuch/database.py | 11 ----------- lib/database.cc | 40 +++++++++++++++++++++++++--------------- lib/directory.cc | 41 +++++++++++++++++++++++++++++++++++------ lib/message.cc | 11 +++++------ lib/notmuch-private.h | 13 +++++++++++++ lib/notmuch.h | 10 ++-------- notmuch-new.c | 36 +++++++----------------------------- test/python | 8 ++++++++ 8 files changed, 95 insertions(+), 75 deletions(-)