[PATCH v2 07/20] nmbug-status: Don't require write access
authorW. Trevor King <wking@tremily.us>
Mon, 10 Feb 2014 18:40:28 +0000 (10:40 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:51 +0000 (09:59 -0800)
1d/c7df9590b432a0d3fda28fdd6a861969169b60 [new file with mode: 0644]

diff --git a/1d/c7df9590b432a0d3fda28fdd6a861969169b60 b/1d/c7df9590b432a0d3fda28fdd6a861969169b60
new file mode 100644 (file)
index 0000000..9062fd7
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9A2C6429E44\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:42:19 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id bbdV5PU532p9 for <notmuch@notmuchmail.org>;\r
+       Mon, 10 Feb 2014 10:42:14 -0800 (PST)\r
+Received: from qmta13.westchester.pa.mail.comcast.net\r
+       (qmta13.westchester.pa.mail.comcast.net [76.96.59.243])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9692A431E62\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:41:56 -0800 (PST)\r
+Received: from omta21.westchester.pa.mail.comcast.net ([76.96.62.72])\r
+       by qmta13.westchester.pa.mail.comcast.net with comcast\r
+       id Qh2Z1n0041ZXKqc5DihwkL; Mon, 10 Feb 2014 18:41:56 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+       by omta21.westchester.pa.mail.comcast.net with comcast\r
+       id Qihv1n006152l3L3hihvsS; Mon, 10 Feb 2014 18:41:56 +0000\r
+Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
+       by odin.tremily.us (Postfix) with ESMTPS id 0F19210167AF;\r
+       Mon, 10 Feb 2014 10:41:55 -0800 (PST)\r
+Received: (nullmailer pid 1257 invoked by uid 1000);\r
+       Mon, 10 Feb 2014 18:40:45 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 07/20] nmbug-status: Don't require write access\r
+Date: Mon, 10 Feb 2014 10:40:28 -0800\r
+Message-Id:\r
+ <ad3828a4c670876c16352a7bc7a147152a7cbb5b.1392056624.git.wking@tremily.us>\r
+X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
+In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
+References: <cover.1392056624.git.wking@tremily.us>\r
+In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
+References: <cover.1392056624.git.wking@tremily.us>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+       s=q20121106; t=1392057716;\r
+       bh=mOi9DNGt/9vulM62iNpwG3mj3ZW5v7HGmIXcbYknaVA=;\r
+       h=Received:Received:Received:Received:From:To:Subject:Date:\r
+       Message-Id:MIME-Version:Content-Type;\r
+       b=RXowinSxD4MhwwZBsJzCwC2p2X0soQMSPoby4XO6U1dD/pihaxyrMTVrdN5pffiNn\r
+       xBpGgu1u4r9eSQdSxtUeB2AZyIdGp7l0asAoIiG2dG8M2w+hnRBtEQdXhAauE9eAmc\r
+       Lz8NipPzS1dpK7KmUJMewptR3yqFpjVToUrLu15+Sur/yBvdXj6qqTcdOR6N0/Cp9V\r
+       Gf2NouKDlwGem7DkmWYfXRj/UT+Vl8FlX2cXR/cKitUiPqvQWf6fux44kh5DpsOAX9\r
+       RnIc/oaZAuzmH1MVV1aDK9m//ObHvaSyrpf+ARtbtDpfZUkywoV619Ooed5KIwISs4\r
+       rCX+IAWuFq/4Q==\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 10 Feb 2014 18:42:19 -0000\r
+\r
+The database in only used for notmuch.Query, so there's no need for\r
+write access.  This allows nmbug-status to run while the database is\r
+being updated, without raising:\r
+\r
+  A Xapian exception occurred opening database: Unable to get write lock on …: already locked\r
+  Traceback (most recent call last):\r
+    File "./nmbug-status", line 182, in <module>\r
+      db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)\r
+    File "/…/notmuch/database.py", line 154, in __init__\r
+      self.open(path, mode)\r
+    File "/…/notmuch/database.py", line 214, in open\r
+      raise NotmuchError(status)\r
+  notmuch.errors.XapianError\r
+---\r
+ devel/nmbug/nmbug-status | 2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
+index 199892f..be3e28e 100755\r
+--- a/devel/nmbug/nmbug-status\r
++++ b/devel/nmbug/nmbug-status\r
+@@ -180,7 +180,7 @@ else:\r
\r
+ # main program\r
\r
+-db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)\r
++db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)\r
\r
+ if output_format == 'html':\r
+     print('''<?xml version="1.0" encoding="utf-8" ?>\r
+-- \r
+1.8.5.2.8.g0f6c0d1\r
+\r