[PATCH 3/3] test: use perl instead of sed -r for portability

Jani Nikula jani at nikula.org
Wed Dec 5 00:13:14 PST 2012


On Wed, 05 Dec 2012, Michal Nazarewicz <mina86 at mina86.com> wrote:
> On Tue, Dec 04 2012, Jani Nikula wrote:
>> Our OS X users report -r is not a supported option for sed. Use perl
>> instead.
>> ---
>>  test/test-lib.sh |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/test/test-lib.sh b/test/test-lib.sh
>> index f169785..31ed107 100644
>> --- a/test/test-lib.sh
>> +++ b/test/test-lib.sh
>> @@ -576,7 +576,7 @@ NOTMUCH_NEW ()
>>  
>>  notmuch_search_sanitize ()
>>  {
>> -    sed -r -e 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
>> +    perl -pe 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
>
> Alternatively, this could just be convert into a basic regexp:
>
> sed -e 's/\("\?thread"\?: \?"\?\)................\("\?\)/\1XXX\2/'
>
> which I think is even more portable, no?

I don't know.

Jani.

>
>>  }
>>  
>>  NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,'
>
> -- 
> Best regards,                                         _     _
> .o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
> ..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
> ooo +----<email/xmpp: mpn at google.com>--------------ooO--(_)--Ooo--


More information about the notmuch mailing list