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

Michal Nazarewicz mina86 at mina86.com
Tue Dec 4 15:01:07 PST 2012


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?

>  }
>  
>  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--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20121205/24412dd6/attachment.pgp>


More information about the notmuch mailing list