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 EAD83431FAF for ; Tue, 21 Aug 2012 07:49:49 -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 6rHkW5d8C4V3 for ; Tue, 21 Aug 2012 07:49:49 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 41355431FAE for ; Tue, 21 Aug 2012 07:49:49 -0700 (PDT) Received: by vcbfl17 with SMTP id fl17so6836798vcb.26 for ; Tue, 21 Aug 2012 07:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=6CKf4619w2jvc/UZ2Fw9HGcbkRAtZQ/PDG36Fj2qz+k=; b=0ia0z0GDaf0nac5rdujX/6xZd7Rbzz3Br05wr3OxleVFMZgWd5I9WeU94c0j6oJVbm KjXmLSi56uCGOcXHckDgwbuX950aD5oc+IVCOZJHlLirZYsYt+co8xIQvi3ElT96y0lp 5ClMw9NgdSfpP0dFv3tpDVmCg/ogU5S/byLhFs1PZ3xed9IrigxGmpOfh+Q6Wfz0fk/3 tPF3gBovRrj2F2m6WHjFLgqb0djB7ypDMgRvr963F/yB0FlNy8WzFiube76b+zQsDCK5 MR+vxotAgHWb/ALOYN+baVws39xdLmiHf6PmtjfP28CjiZMcmo8V4oxq4keYuGWnVrOd 7zCw== Received: by 10.220.148.210 with SMTP id q18mr13684647vcv.6.1345560588715; Tue, 21 Aug 2012 07:49:48 -0700 (PDT) Received: from localhost (pool-108-8-230-85.spfdma.east.verizon.net. [108.8.230.85]) by mx.google.com with ESMTPS id br15sm763977vdb.13.2012.08.21.07.49.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Aug 2012 07:49:48 -0700 (PDT) From: Ben Gamari To: Tomi Ollila , notmuch Subject: Re: [PATCH 1/3] Add notmuch_database_close_compact In-Reply-To: References: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com> <1345476704-17091-2-git-send-email-bgamari.foss@gmail.com> User-Agent: Notmuch/0.13.2+137~g3dc1094 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Tue, 21 Aug 2012 10:49:47 -0400 Message-ID: <87y5l8z4dw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Tue, 21 Aug 2012 14:49:50 -0000 Tomi Ollila writes: > On Mon, Aug 20 2012, Ben Gamari wrote: > >> --- >> configure | 25 ++++++++++++++++++++++++- >> lib/database.cc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> lib/notmuch.h | 14 ++++++++++++++ >> 3 files changed, 92 insertions(+), 1 deletion(-) >> >> diff --git a/configure b/configure >> index dc0dba4..370fedd 100755 >> --- a/configure >> +++ b/configure >> @@ -270,7 +270,8 @@ printf "Checking for Xapian development files... " >> have_xapian=0 >> for xapian_config in ${XAPIAN_CONFIG}; do >> if ${xapian_config} --version > /dev/null 2>&1; then >> - printf "Yes (%s).\n" $(${xapian_config} --version | sed -e 's/.* //') >> + xapian_version=$(${xapian_config} --version | sed -e 's/.* //') >> + printf "Yes (%s).\n" ${xapian_version} >> have_xapian=1 >> xapian_cxxflags=$(${xapian_config} --cxxflags) >> xapian_ldflags=$(${xapian_config} --libs) >> @@ -282,6 +283,24 @@ if [ ${have_xapian} = "0" ]; then >> errors=$((errors + 1)) >> fi >> >> +have_xapian_compact=0 >> +if [ ${have_xapian} = "1" ]; then >> + printf "Checking for Xapian compact support... " >> + IFS='.' >> + old_args=$@ >> + set -- ${xapian_version} >> + xapian_major_version=$1 >> + xapian_minor_version=$2 >> + xapian_subminor_version=$3 >> + set -- ${old_args} > > The part above breaks the argument vector in case there are spaces in > args (I though $IFS chars, but try the script), execute: > Hmmm, I suppose so. > $ echo '#!/bin/bash > IFS=. > for x in "$@"; do echo $x; done; echo > foo=$@ > for x in $foo; do echo $x; done; echo > set -- $foo > for x in "$@"; do echo $x; done; echo > ' > foo.bash > > $ bash foo.bash a "b c" d > > Also, after processing, IFS is not restored (to $DEFAULT_IFS) > I assumed this would be alright since IFS is set in the next > an alternative is to put the code in function like the following > way: > Sounds good to me. > Hmm, I guess the check above is to determine whether xapian version is > 1.2.6 or newer, but is there xapian version 1.1.6 or 1.0.6 or 0.3.0 or so ? > Eh? 1.2.6 is the first Xapian release to have Compactor exposed in the public API. > I am not qualified to comment about compaction itself :) > Nor am I really. I just noticed that this functionality was blocking on library support which is now in place. It seemed that a pretty straightforward thing to implement and it hasn't broken my index yet. > In the last patch you give copyright to Carl (which is OK). However I'd > debate whether it is good practise to declare Carl as author; I'd say that > is OK if he agrees to claim authorship to your potentially shi^H^H^Hperfect > code ;) > Yikes. That certainly wasn't intentional. I'll fix this in the next iteration. > There are at least a few style issues below: e.g. no space between function > name and opening parenthesis. > Duly noted. Thanks! Cheers, - Ben