Gentoo Archives: gentoo-dev

From: Jeroen Roovers <jer@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] RFC: sed script redundancy
Date: Fri, 20 May 2011 15:40:17
Message-Id: 20110520173922.391ea292@epia.jer-c2.orkz.net
1 Hullo developers,
2
3
4 for a while now I've been wondering if all those sed scripts in all
5 those ebuilds are really effective.
6
7 To find out, I've tried a couple of angles on a sed hook that basically
8 dissects the sed command line provided, divides everything up into sed
9 scripts, files being processed and other options, and runs everything
10 through diff to get some meaningful QA output as to the effective use
11 of the sed scripts invoked.
12
13 Of course some of the time a sed script falsely seems to be ineffective,
14 but could be, when it uses some variable or output that varies depending
15 on the platform you run it on, like with the likes of $(get_libdir).
16
17 I've looked into sed's internal solutions to no avail, but something
18 like -i[SUFFIX] might help, since it gives you a backup file to compare
19 with the file that's being streamed.
20
21 The idea is to pass the result to
22 | diff -u $file $file[SUFFIX]
23 to figure out what was changed, and what sed script changed it.
24
25 Any help?
26
27
28 jer
29
30
31 PS: Because the outcome may depend on the platform you run the scripts
32 on, this probably shouldn't make it into a QA test in portage, but it
33 could still help developers evaluate how effective their ebuilds' and
34 eclasses' sed scripts are.

Replies

Subject Author
Re: [gentoo-dev] RFC: sed script redundancy Fabian Groffen <grobian@g.o>
[gentoo-dev] Re: RFC: sed script redundancy Ryan Hill <dirtyepic@g.o>
Re: [gentoo-dev] RFC: sed script redundancy Jeroen Roovers <jer@g.o>