From 9d5e325b40366b043a767386d0b7df67c0de0ecd Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 14 May 2012 19:36:12 +2000 Subject: [PATCH] [PATCH v2 4/5] ruby: Update for changes to notmuch_database_get_directory --- 66/c00ef3ce2a7af625fd61026be4f9513a6684a9 | 112 ++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 66/c00ef3ce2a7af625fd61026be4f9513a6684a9 diff --git a/66/c00ef3ce2a7af625fd61026be4f9513a6684a9 b/66/c00ef3ce2a7af625fd61026be4f9513a6684a9 new file mode 100644 index 000000000..2e2e71c2d --- /dev/null +++ b/66/c00ef3ce2a7af625fd61026be4f9513a6684a9 @@ -0,0 +1,112 @@ +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 29442431FD5 + for ; Sun, 13 May 2012 16:36:27 -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 IORQbugeM98N for ; + Sun, 13 May 2012 16:36:24 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id A78C2431FBD + for ; Sun, 13 May 2012 16:36:23 -0700 (PDT) +X-AuditID: 1209190e-b7fd86d0000008b4-4c-4fb04576ea48 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 90.32.02228.67540BF4; Sun, 13 May 2012 19:36:22 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q4DNaLva025784; + Sun, 13 May 2012 19:36:22 -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 q4DNaKS2001100 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sun, 13 May 2012 19:36:21 -0400 (EDT) +Received: from amthrax by drake.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1STiKq-0004YS-9o; Sun, 13 May 2012 19:36:20 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH v2 4/5] ruby: Update for changes to + notmuch_database_get_directory +Date: Sun, 13 May 2012 19:36:12 -0400 +Message-Id: <1336952173-17422-5-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1336952173-17422-1-git-send-email-amdragon@mit.edu> +References: <1336939029-13969-1-git-send-email-amdragon@mit.edu> + <1336952173-17422-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsUixCmqrFvmusHfYPIfLovZrT+YLG60djNa + NE13trh+cyazxZuV81gdWD0Of13I4jHx/Gk2j1v3X7N7PFt1i9ljy6H3zAGsUVw2Kak5mWWp + Rfp2CVwZ+8+eYi5YyVEx/aZOA+MFti5GTg4JAROJhVc+MULYYhIX7q0HinNxCAnsY5SYtaCb + BcLZwChx81kXM4Rzn0niyY13TBDOLEaJ1bcmg81iE9CQ2LZ/OdgsEQFpiZ13Z7OCFDELdDFK + /H7TDNTOwSEsECTx7EEQSA2LgKrE9gufWEBsXgEHic+P17JD3CEv8fR+H9hMTgFHib4HH8Hi + QgLlEjPar7NMYORfwMiwilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdYLzezRC81pXQTIzgIJfl2 + MH49qHSIUYCDUYmH95XpBn8h1sSy4srcQ4ySHExKorxMTkAhvqT8lMqMxOKM+KLSnNTiQ4wS + HMxKIrzrH673F+JNSaysSi3Kh0lJc7AoifOqab3zExJITyxJzU5NLUgtgsnKcHAoSfAudgEa + KliUmp5akZaZU4KQZuLgBBnOAzT8DEgNb3FBYm5xZjpE/hSjopQ47xWQhABIIqM0D64XliRe + MYoDvSLMWw9SxQNMMHDdr4AGMwEN5hdYBzK4JBEhJdXAGLTk/ssZwZNWf3t7V8GsWzv3rZpM + iHfE8nOxgbvFOiMYOs/ctW3O6AoLTlruy3m8P/5Jg3zgpHfl0Q5nY9ir3wt7dhsG759d03XL + /RNvTa6YG3fGsSXTZl6cmGsSxV0gNNPW/Z7Mn/B7J3WOlP1l8/vbveT4XPutMzyaZzst09xc + MiP754EKJZbijERDLeai4kQA7jR7pe0CAAA= +Cc: tomi.ollila@iki.fi +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, 13 May 2012 23:36:27 -0000 + +--- + bindings/ruby/database.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c +index 409d54f..e84f726 100644 +--- a/bindings/ruby/database.c ++++ b/bindings/ruby/database.c +@@ -252,6 +252,7 @@ VALUE + notmuch_rb_database_get_directory (VALUE self, VALUE pathv) + { + const char *path; ++ notmuch_status_t ret; + notmuch_directory_t *dir; + notmuch_database_t *db; + +@@ -260,11 +261,11 @@ notmuch_rb_database_get_directory (VALUE self, VALUE pathv) + SafeStringValue (pathv); + path = RSTRING_PTR (pathv); + +- dir = notmuch_database_get_directory (db, path); +- if (!dir) +- rb_raise (notmuch_rb_eXapianError, "Xapian exception"); +- +- return Data_Wrap_Struct (notmuch_rb_cDirectory, NULL, NULL, dir); ++ ret = notmuch_database_get_directory (db, path, &dir); ++ notmuch_rb_status_raise (ret); ++ if (dir) ++ return Data_Wrap_Struct (notmuch_rb_cDirectory, NULL, NULL, dir); ++ return Qnil; + } + + /* +-- +1.7.10 + -- 2.26.2