automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] test defs: add subroutine for input unindenting


From: Ralf Wildenhues
Subject: Re: [PATCH] test defs: add subroutine for input unindenting
Date: Wed, 16 Feb 2011 06:12:43 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

* Stefano Lattarini wrote on Wed, Feb 16, 2011 at 12:29:02AM CET:
> On Tuesday 15 February 2011, Ralf Wildenhues wrote:
> > The space after : is not portable.  The sed script could be shortened to
> >   sed -n "/[^ $tab].*$/{
> >             s///p
> >             d
> >           }"
> >
> Did you mean 'q' instead of 'd' here, right?

Yes.  Sorry about that.

> > It's a bit of a shame this uses a temp file though.  awk should be able
> > to cope without
> >
> Yes, if I could assume "new" awk.  But traditional awk lacks the 'sub()'
> and 'gsub()' builtins, so I really really don't want to go down that road.
> Moreover, the use of a tempfile is not a big issue here, because we can
> already assume the existence of a temporary working directory (i.e., the
> one the test runs in) and of a cleanup trap (installed by `tests/defs').

True.  One would assume that it's not common to use more than one
function invocation in parallel:
  deindent foo | deindent > ...

or:
  deindent foo > ... & deindent bar ...

> But if you truly truly dislike the use of the tempfile, I could try to
> use perl instead...  WDYT?

That'll slow things down more than using a temp file, so I'm reasonably
happy with sed+sed right now.

Thanks,
Ralf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]