1 |
On 04/26/2012 03:08 PM, Duncan wrote: |
2 |
> Zac Medico posted on Thu, 26 Apr 2012 08:21:02 -0700 as excerpted: |
3 |
>> Also, don't forget to consider the possibility of interference between |
4 |
>> FEATURES=userpatch and epatch_user (applying same patches twice). |
5 |
> |
6 |
> The existing phaselock-file solution should continue to work there. Test |
7 |
> for the existence of a file and punt if it's found; touch the file on |
8 |
> first invocation. |
9 |
> |
10 |
> The only caveat is that the existing eclass solution has changed the |
11 |
> filename before. Once the corresponding feature exists, both the eclass |
12 |
> and the feature will have to use the same filename so as not to conflict |
13 |
> with each other, thereby effectively locking down the name and preventing |
14 |
> further changes to it. |
15 |
|
16 |
Having the package manager interact with an eclass function like |
17 |
epatch_user is ugly, and it's unnecessary since we can pull all of the |
18 |
pieces into the package manager in EAPI 5. Any eclasses that currently |
19 |
call epatch_user can have a conditional like this: |
20 |
|
21 |
if has $EAPI 0 1 2 3 4 ; then |
22 |
epatch_user |
23 |
else |
24 |
apply_user_patches_here |
25 |
fi |
26 |
|
27 |
>> Overall, the "apply_user_patches_here" approach [1] seems pretty |
28 |
>> reasonable to me. |
29 |
>> |
30 |
>> [1] |
31 |
>> http://archives.gentoo.org/gentoo-dev/ |
32 |
> msg_c228be85e0c4e577ad194e6004d59062.xml |
33 |
> |
34 |
> With the requirements that if the ebuild never calls it, it's still run |
35 |
> immediately after source_prepare, thus ensuring that it gets called, AND |
36 |
> that calling either autoreconf or eautoreconf without calling apply-user- |
37 |
> patches first is a repoman-checked error, it looks like it should work, |
38 |
> agreed. |
39 |
|
40 |
I think it might be better to die if it's not called in src_prepare, |
41 |
like Ciaran originally suggested. This ensures that people don't forget |
42 |
to call it when they are supposed to. |
43 |
|
44 |
> But I'm a bit wary as to the robustness. And without a mechanism to |
45 |
> apply the patches at a particular point (arguably, post-src-prepare) even |
46 |
> in the absence of a specific apply-user-patches-here call, we're back |
47 |
> where we were without a global solution, but if the hard-invocation is |
48 |
> done, then we're back to either inefficiently running eautoreconf twice |
49 |
> or forced into doing likely failure-prone detection, thus the worry over |
50 |
> robustness. |
51 |
|
52 |
It's no worse than epatch_user currently is. It's the responsibility of |
53 |
the person who overrides src_prepare to call eautoreconf or whatever |
54 |
else when necessary, so the package manager will not have the burden. |
55 |
-- |
56 |
Thanks, |
57 |
Zac |