Gentoo Archives: gentoo-dev

From: Chris Houser <chouser@g.o>
To: gentoo-dev@g.o
Cc: gentoo-dev@××××××××××.org
Subject: Re: [gentoo-dev] sed "" file| cat > file
Date: Mon, 14 Jan 2002 10:09:14
Message-Id: 20020114110943.B413812@plato.zk3.dec.com
In Reply to: Re: [gentoo-dev] sed "" file| cat > file by Mikael Hallendal
1 Mikael Hallendal wrote: [Mon Jan 14 2002, 5:16:02AM EST]
2 > mån 2001-11-12 klockan 03.52 skrev Aron Griffis:
3 > > jano wrote: [Sun Nov 11 2001, 09:49:49PM EST]
4 > > > I don't understand why this works for some and not for others; is it an
5 > > > issue of system performance?
6 > >
7 > > It's a race condition, and it should never be done. Instead, ebuild
8 > > authors should use dosed, which is exactly for this purpose.
9 > >
10 > > dosed 's/foo/bar/' Makefile
11 >
12 > Is this supposed to work?
13 >
14 > It doesn't do anything for me.
15
16 dosed is currently written to only work on files in ${D}, and the sed
17 script defaults to deleting all occurances of ${D} in the named files.
18 This makes it ideal for "fixing" paths in text files during the ebuild
19 'install' phase, but useless for patching sources during the 'unpack'
20 phase.
21
22 Not that you would know this from reading the dosed internal
23 documentation, since there isn't any. :-/
24
25 Anyway, perhaps someone should update dosed or writing something similar
26 for use during 'unpack'. Until then, what I generally do is:
27
28 t=Makefile
29 cp $t $t.orig
30 sed 's/foo/bar/' $t.orig > $t
31
32 --Chouser

Replies

Subject Author
Re: [gentoo-dev] sed "" file| cat > file Daniel Robbins <drobbins@g.o>