This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Support cross-testing (version 3)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Roland McGrath <roland at hack dot frob dot com>, <libc-alpha at sourceware dot org>
- Date: Fri, 2 Nov 2012 18:09:35 +0000
- Subject: Re: Support cross-testing (version 3)
- References: <Pine.LNX.4.64.1210242035130.14661@digraph.polyomino.org.uk><20121024213718.0A4FC2C09B@topped-with-meat.com><Pine.LNX.4.64.1210242300040.14661@digraph.polyomino.org.uk> <m2390r99mw.fsf@igel.home>
On Fri, 2 Nov 2012, Andreas Schwab wrote:
> "Joseph S. Myers" <joseph@codesourcery.com> writes:
>
> > +# Remove unnecessary newlines from a Bourne shell command sequence.
> > +remove_newlines ()
> > +{
> > + sed -n \
> > + -e '1h' \
> > + -e '2,$H' \
> > + -e '${g
> > + s/\([^\]\)\n/\1; /g
> > + p
> > + }'
> > +}
>
> That doesn't work with embedded newlines.
As I just said, I'd be happy for it to be removed. Fortunately nothing is
relying on environment variables with newlines being passed through this
way, and as I've also said I think we should aim for not needing this
environment variable passthrough by getting everywhere relying on
environment variables set in makefiles, at top of scripts etc. being
applicable on the host to pass them explicitly via test-wrapper-env - but
that cleanup may be a longer-term goal (it requires checking a lot of code
that might set environment variables and working out where their values
are needed).
I'm not sure what "The 'export -p' command adds backslashes for
environment variables which contain newlines." was originally referring to
- maybe some way in which the output of older versions of bash differed
from what bash now does. (This optimization originated in
<http://www.eglibc.org/archives/patches/msg00318.html> in 2007.)
--
Joseph S. Myers
joseph@codesourcery.com