Marijn Schouten (hkBst) kirjoitti:
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?

Marijn

[1]: http://bugs.gentoo.org/show_bug.cgi?id=217735


You should just fix the Makefile to respect DESTDIR and send the patch upstream.

Regards,
Petteri

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to