Gentoo Archives: gentoo-alt

From: "Gregory M. Turner" <gmt@×××××.us>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] eprefixify_patch
Date: Tue, 03 Apr 2012 18:05:49
Message-Id: 3bd577fb-377e-4f2c-8108-b48fbef4f3ca@malth.us
In Reply to: Re: [gentoo-alt] eprefixify_patch by Fabian Groffen
1 ----- Original Message -----
2 > On 03-04-2012 08:37:57 -0000, Gregory M. Turner wrote:
3 > > Current prefix SOP is to epatch a bunch of files with
4 > > @GENTOO_PORTAGE_EPREFIX@ and then eprefixify the affected files.
5 > > Although this adds a bit of precision and flexibility, it leads
6 > > to laundry lists in the ebuild, especially if/when we start
7 > > getting more rigorous about prefixification. The attached eclass
8 > > provides eprefixify_patch, which simply prefixifies the patch
9 > > itself before applying.
10 >
11 > Feels dirty too ;)
12
13 Admittedly, there is a certain inelegance there. But I can't imagine a real-world scenario which both: would correctly be solved by 'patch + eprefixify'; but would not correctly be solved by eprefixify_patch. It would have to be something like, "well, foo.patch puts '@GENTOO_PORTAGE_EPREFIX@' into 20 different places in '${S}', but only 18 of them are to be eprefixified; the other two are correct patches to the source", which hardly seems like a use-case worth preserving.
14
15 The idea is to promote clarity and correctness by:
16
17 o Eliminating redundant information (files in patch vs. files eprefixified
18 in ebuild)
19
20 o Eliminating potential for error (did we remember to eprefixify all the files
21 that we patched? did we leave behind formerly-eprefixified files in the
22 ebuild?)
23
24 o Minimizing prefix-specific changes to ebuilds be getting rid of laundry-lists
25
26 o Encouraging a clear distinction between two types of patches: normal patches,
27 which typically are reverse-able and have legitimate source files as both
28 their input and output, and "eprefixification" patches, which leave the
29 source in an intermediate state, and become pseudo-irreversible once that
30 intermediate state is resolved back to a source-file (plus, this
31 approach makes them reversible again).
32
33 > > It also includes some quick & dirty tools to prefixify /bin/{ba,}sh
34 > > shebangs. I'm using both in my overlay. So far, so good. What
35 > > I'm using it /for/ is a more interesting question that I'd like to
36 > > bring up in a separate, presumably more controversial thread.
37 > > Anyhow, for the moment I thought these might come in handy or at
38 > > least precipitate an interesting flamewar :)
39 >
40 > I fail to see how this is necessary. Portage already fixes
41 > those/these shebangs, doesn't it?
42
43 Not on my system (which isn't saying much :) )... Where is that supposed to be happening? I have a vague memory of prefix-portage doing this at one time, but the code is not jumping out at me.
44
45 -gmt