Re: [PATCH 1/3] Add notmuch_database_close_compact

Subject: Re: [PATCH 1/3] Add notmuch_database_close_compact

Date: Thu, 23 Aug 2012 05:56:57 +0000

To: Tomi Ollila

Cc: notmuch

From: Kim Minh Kaplan


Tomi Ollila :

> On Tue, Aug 21 2012, Ben Gamari wrote:
>
>> Eh? 1.2.6 is the first Xapian release to have Compactor exposed in the
>> public API.
>
> 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)

Try:

    case "${xapian_version}" in
         0.*|1.[01].*|1.2.[0-5]) ;;
         *) ... ;;
    esac

Kim Minh.

Thread: