On 15-04-2008 13:05:26 +0200, Santiago M. Mola wrote:
> On Tue, Apr 15, 2008 at 1:14 PM, Marijn Schouten (hkBst)
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi list,
> >
> > it seems I have been using some fragile sed expression and I'd like to tap
> > the collective
> > wisdom for avoiding doing that in the future.
> >
> > dev-scheme/slib-3.1.5-r1 currently does
> >
> > sed "s_prefix = /usr/local/_prefix = ${D}/usr/_" -i Makefile
> >
> > to make it not violate the sandbox. However a user had set
> > PORTAGE_TMPDIR=/home/gentoo_overflow/tmp causing the sed expression to
> > contain too may
> > underscores and failing.[1]
> >
> > There are several option to handle this. I could use a less common
> > delimiter or I could
> > escape it: ${D//_/\_} instead of ${D}. I could use a sed expression that
> > doesn't suffer
> > from this problem (thanks to dleverton):
> >
> > sed -ne '\_^prefix = /usr/local_!{p;d}' -e "iprefix = ${D}" -i Makefile
> >
> > Comments?
> >
>
> Currently is use ':' as sed delimiter when paths are involved. I'd
> also like to hear from you about proper delimiters if you think ':' is
> not safe enough.
I met one case where : was indeed a problem, but that was in
CFLAGS/LDFLAGS replacements. Some linkers accept (and do require)
arguments that are like "-mg:2512s".
> AFAIK, the only corner case which would make this fail would be
> Windows paths (C:/gentoo-prefix).
C:\ iirc, but Cygwin seems to map this as /cygdrive/C, Interix as
/dev/fs/C, command prompt I have no clue how portage could ever normally
work there. SpikeSource's SpikeWAMP uses Cygwin underneath, so
Portage/ebuilds will see the mapped paths only, never heard of any
problems from them regarding this either.
--
Fabian Groffen
Gentoo on a different level
--
[email protected] mailing list