1 |
Hi there! |
2 |
|
3 |
On 19.02.2010 22:23, Ladislav Laska wrote: |
4 |
> Hello again, |
5 |
> |
6 |
> I have decided to continue discussion in new thread. This discussion |
7 |
> was started in thread "kde-sunset: kdepim-kresources broken". |
8 |
> |
9 |
> I have replaced my code with what I originally intended (the code in |
10 |
> git is wrong, since I made a mistake editing it - here is what I |
11 |
> intended): |
12 |
> |
13 |
> # Check for PATCHES in EAPI=0|1 |
14 |
> case ${EAPI:-0} in |
15 |
> 0|1) |
16 |
> if [[ -n ${PATCHES} ]] && [[ -d "${KDE_S}" ]]; then |
17 |
> base_src_prepare |
18 |
> fi |
19 |
> ;; |
20 |
> esac |
21 |
> |
22 |
> Look, for example, at kde-base/ark ebuild. There is a patch, but it's |
23 |
> not applied correctly without my code. |
24 |
|
25 |
media-gfx/gwenview-1.4.2-r3, on the other hand, would try applying |
26 |
patches twice /with/ your code. |
27 |
|
28 |
> What I'm worried about is the check [[ -d "${KDE_S}" ]] makes sure, |
29 |
> that this code is called if |
30 |
> |
31 |
> [[ -d "${KDE_S}" ]] || base_src_unpack unpack |
32 |
> |
33 |
> did not called base-src_unpack and therefore did not applied patches. |
34 |
> |
35 |
> There are two problems with EAPI=0|1 |
36 |
> |
37 |
> 1) It depends on file naming and will not work if base_src_unpack |
38 |
> unpacks into $KDE_S |
39 |
|
40 |
You mean kde-meta_src_unpack does unpack into $KDE_S, right? |
41 |
|
42 |
I just had a look. For kde-base/ark, kde-meta_src_unpack does unpack |
43 |
part of the tarball, therefore kde_src_unpack won't call |
44 |
base_src_unpack, therefore base_src_prepare won't get called either. |
45 |
|
46 |
> 2) Even if base_src_unpack calls base_src_prepare, we're adding |
47 |
> patches automatically after this call, but they will not be applied. |
48 |
|
49 |
You're right, there is code collecting additional patches from $PATCHDIR |
50 |
into the $PATCHES array. So we need to call base_src_prepare /after/ |
51 |
that, while the current base_src_unpack call comes before that, and |
52 |
unpacking has to come before that as $PATCHDIR is unpacked as well. |
53 |
|
54 |
As base_src_unpack calls base_src_prepare unconditionally for recent |
55 |
incarnations of base.eclass, I feel we cannot call base_src_unpack at |
56 |
all. Instead we should simply call "unpack ${A}" directly, and |
57 |
base_src_prepare later on. |
58 |
|
59 |
I feel that this code collecting and applying $PATCHES would be better |
60 |
suited to a kde_src_prepare than kde_src_unpack, but I'm not sure it's |
61 |
worth refactoring kde.eclass. |
62 |
|
63 |
> Since I can't think of correct check, please let me know if you have |
64 |
> an idea. Also, let me know if I'm wrong about something and it's not |
65 |
> needed at all. (but I doubt that, because ark, as mentioned above, is |
66 |
> counterexample) |
67 |
|
68 |
No, you are correct in diagnosing the problem. I just had another stab |
69 |
at a solution. Have a look at 5979aefafa6e200a09d5dd7b3a6e99b3e0a9d74e |
70 |
and see if you find any package where that approach doesn't work. |
71 |
|
72 |
Greetings, |
73 |
Martin |