[PATCH 1/3] Add notmuch_database_close_compact

Tomi Ollila tomi.ollila at iki.fi
Tue Aug 21 23:07:14 PDT 2012


On Tue, Aug 21 2012, Ben Gamari wrote:

> Tomi Ollila <tomi.ollila at iki.fi> writes:
>
>> On Mon, Aug 20 2012, Ben Gamari <bgamari.foss at gmail.com> 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


More information about the notmuch mailing list