1 |
Dnia 29 października 2015 09:28:53 CET, Ulrich Mueller <ulm@g.o> napisał(a): |
2 |
>>>>>> On Wed, 28 Oct 2015, Ulrich Mueller wrote: |
3 |
> |
4 |
>> It is late in the EAPI 6 process, but I believe that the patch below |
5 |
>> is a good change. We should specify a return status for eapply_user. |
6 |
> |
7 |
>Patch v2, with logic inverted: |
8 |
> 0 = sources are unmodified |
9 |
> 1 = patches applied successfully |
10 |
> 2 = failure |
11 |
> |
12 |
>Rationale: The relevant information is if sources are unmodified or |
13 |
>(potentially) modified, so these two states should correspond to shell |
14 |
>true and false, respectively. |
15 |
> |
16 |
>Also seems natural to return 0 in the most common case that there are |
17 |
>no user patches, and in the case that eapply_user() is a no-op. |
18 |
|
19 |
Nah, that's going to be confusing. |
20 |
|
21 |
if ! eapply_user; then |
22 |
# patches were applied...?! |
23 |
|
24 |
I'd go for: |
25 |
|
26 |
0 - applied |
27 |
1 - no patches |
28 |
and die on failure |
29 |
|
30 |
> |
31 |
>> Please review. |
32 |
> |
33 |
>Ulrich |
34 |
> |
35 |
> |
36 |
>From ae6782cc84e18c8c39c2583731ffed0e258db209 Mon Sep 17 00:00:00 2001 |
37 |
>From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@g.o> |
38 |
>Date: Thu, 29 Oct 2015 08:10:42 +0100 |
39 |
>Subject: [PATCH] EAPI 6: Specify return status for eapply_user. |
40 |
> |
41 |
>Suggested by dilfridge. |
42 |
>--- |
43 |
> pkg-mgr-commands.tex | 6 ++++-- |
44 |
> 1 file changed, 4 insertions(+), 2 deletions(-) |
45 |
> |
46 |
>diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex |
47 |
>index 51f6ebf..0668686 100644 |
48 |
>--- a/pkg-mgr-commands.tex |
49 |
>+++ b/pkg-mgr-commands.tex |
50 |
>@@ -157,10 +157,12 @@ Ebuilds must not run any of these commands once |
51 |
>the current phase function has r |
52 |
>\item[eapply\_user] \featurelabel{eapply-user} Takes no arguments. |
53 |
>Package managers supporting it |
54 |
>apply user-provided patches to the source tree in the current working |
55 |
>directory. Exact behaviour |
56 |
>is implementation defined and beyond the scope of this specification. |
57 |
>Package managers not |
58 |
>- supporting it must implement the command as a no-op. Only |
59 |
>available in EAPIs listed in |
60 |
>+ supporting it must implement the command as a no-op. Returns 0 if |
61 |
>the sources are unmodified, |
62 |
>+ or 1 if patches applied successfully. On failure, returns 2 when |
63 |
>called using \t{nonfatal}, |
64 |
>+ otherwise aborts the build process. Only available in EAPIs listed |
65 |
>in |
66 |
>table~\ref{tab:patch-commands} as supporting \t{eapply\_user}. In EAPIs |
67 |
>where it is supported, |
68 |
>\t{eapply\_user} must be called once in the \t{src\_prepare} phase; for |
69 |
>any subsequent calls |
70 |
>- the command will do nothing. |
71 |
>+ the command will do nothing, and it will return the same status as |
72 |
>for the first call. |
73 |
> \end{description} |
74 |
> |
75 |
> \begin{algorithm} |
76 |
|
77 |
-- |
78 |
Best regards, |
79 |
Michał Górny |