From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JlmX2-0001ZG-3D for garchives@archives.gentoo.org; Tue, 15 Apr 2008 14:53:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ACDACE06ED; Tue, 15 Apr 2008 14:53:10 +0000 (UTC) Received: from smtp03.tky.fi (smtp03.tky.fi [82.130.63.73]) by pigeon.gentoo.org (Postfix) with SMTP id 5C899E06ED for ; Tue, 15 Apr 2008 14:53:10 +0000 (UTC) Received: from [82.130.46.219] ([82.130.46.219]) by smtp03.tky.fi (SMSSMTP 4.1.9.35) with SMTP id M2008041517530827116 for ; Tue, 15 Apr 2008 17:53:08 +0300 Message-ID: <4804C141.7010705@gentoo.org> Date: Tue, 15 Apr 2008 17:52:49 +0300 From: =?UTF-8?B?UGV0dGVyaSBSw6R0eQ==?= User-Agent: Thunderbird 2.0.0.12 (X11/20080328) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] escaping variables in sed expressions References: <48048E31.6040209@gentoo.org> In-Reply-To: <48048E31.6040209@gentoo.org> X-Enigmail-Version: 0.95.6 OpenPGP: url=http://users.tkk.fi/~praty/public.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig065A0BB08FE48F00EF47FFD4" X-Archives-Salt: 1edc1bf8-9a85-4199-81f4-83ecac29833b X-Archives-Hash: 021496a99668d878faa321b0eeb26215 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig065A0BB08FE48F00EF47FFD4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Marijn Schouten (hkBst) kirjoitti: > Hi list, >=20 > 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. >=20 > dev-scheme/slib-3.1.5-r1 currently does >=20 > sed "s_prefix =3D /usr/local/_prefix =3D ${D}/usr/_" -i Makefile >=20 > to make it not violate the sandbox. However a user had set > PORTAGE_TMPDIR=3D/home/gentoo_overflow/tmp causing the sed expression t= o=20 > contain too may > underscores and failing.[1] >=20 > There are several option to handle this. I could use a less common=20 > delimiter or I could > escape it: ${D//_/\_} instead of ${D}. I could use a sed expression tha= t=20 > doesn't suffer > from this problem (thanks to dleverton): >=20 > sed -ne '\_^prefix =3D /usr/local_!{p;d}' -e "iprefix =3D ${D}" -i Make= file >=20 > Comments? >=20 > Marijn >=20 > [1]: http://bugs.gentoo.org/show_bug.cgi?id=3D217735 >=20 You should just fix the Makefile to respect DESTDIR and send the patch=20 upstream. Regards, Petteri --------------enig065A0BB08FE48F00EF47FFD4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgEwUQACgkQcxLzpIGCsLSoEQCfSq7cFbRQD3mjDS0OAClqqRUT QVgAnjDRyFeGhlu2lrv5GQw4GsEiti/o =bgz9 -----END PGP SIGNATURE----- --------------enig065A0BB08FE48F00EF47FFD4-- -- gentoo-dev@lists.gentoo.org mailing list