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 C5D26431FAF for ; Tue, 21 Aug 2012 23:07:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 aYOfwdBOQnYS for ; Tue, 21 Aug 2012 23:07:06 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id B50D6431FAE for ; Tue, 21 Aug 2012 23:07:06 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 2B332100386; Wed, 22 Aug 2012 09:07:14 +0300 (EEST) From: Tomi Ollila To: Ben Gamari , notmuch Subject: Re: [PATCH 1/3] Add notmuch_database_close_compact In-Reply-To: <87y5l8z4dw.fsf@gmail.com> References: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com> <1345476704-17091-2-git-send-email-bgamari.foss@gmail.com> <87y5l8z4dw.fsf@gmail.com> User-Agent: Notmuch/0.14+8~gd6b499d (http://notmuchmail.org) Emacs/23.1.1 (x86_64-redhat-linux-gnu) X-Face: HhBM'cA~ 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: Wed, 22 Aug 2012 06:07:11 -0000 On Tue, Aug 21 2012, Ben Gamari wrote: > Tomi Ollila writes: > >> On Mon, Aug 20 2012, Ben Gamari wrote: >> > >> 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. The comparison code >>> if [ "${xapian_major_version}" -gt 1 ] || >>> [ ${xapian_minor_version} -gt 2 ] || >>> [ ${xapian_subminor_version} -ge 6 ]; then would match e.g. 1.1.6, 1.0.6 and 0.3.0 Presuming that those variables are always numeric the comparison could be: if [ ${xapian_major_version} -gt 1 ] || [ ${xapian_major_version} -eq 1 -a ${xapian_minor_version} -gt 2 ] || [ ${xapian_major_version} -eq 1 -a ${xapian_minor_version} -eq 2 -a \ ${xapian_subminor_version} -ge 6 ]; then (I could not figure out anything shorter and/or cleaner) > > Thanks! > > Cheers, > > - Ben Tomi