1 |
On 3/9/19 12:16 AM, Ulrich Müller wrote: |
2 |
> When the fallback from S to WORKDIR was made conditional in EAPI 4, |
3 |
> src_test() was originally omitted. This has been fixed retroactively |
4 |
> in PMS: |
5 |
> https://gitweb.gentoo.org/proj/pms.git/commit/?id=0038f90a942f0856ae2533b26f709002a3ec80ae |
6 |
> |
7 |
> There should be no issues with backwards compatibility of existing |
8 |
> ebuilds. The feature is not used in the Gentoo repository. Plus, the |
9 |
> scenario is very unlikely, because in src_test the fallback to WORKDIR |
10 |
> could only happen for an ebuild that: |
11 |
> - Has no files in A to be unpacked. |
12 |
> - Doesn't define any of the unpack, prepare, configure, compile or |
13 |
> install phases (otherwise it would die in one of these phases). |
14 |
> |
15 |
> Signed-off-by: Ulrich Müller <ulm@g.o> |
16 |
> --- |
17 |
> bin/phase-functions.sh | 8 ++++++-- |
18 |
> 1 file changed, 6 insertions(+), 2 deletions(-) |
19 |
> |
20 |
> diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh |
21 |
> index d8ebf3d3e..4c6420bfa 100644 |
22 |
> --- a/bin/phase-functions.sh |
23 |
> +++ b/bin/phase-functions.sh |
24 |
> @@ -358,7 +358,7 @@ __abort_install() { |
25 |
> |
26 |
> __has_phase_defined_up_to() { |
27 |
> local phase |
28 |
> - for phase in unpack prepare configure compile install; do |
29 |
> + for phase in unpack prepare configure compile test install; do |
30 |
> has ${phase} ${DEFINED_PHASES} && return 0 |
31 |
> [[ ${phase} == $1 ]] && return 1 |
32 |
> done |
33 |
> @@ -497,8 +497,12 @@ __dyn_test() { |
34 |
> |
35 |
> if [ -d "${S}" ]; then |
36 |
> cd "${S}" |
37 |
> - else |
38 |
> + elif ___eapi_has_S_WORKDIR_fallback; then |
39 |
> + cd "${WORKDIR}" |
40 |
> + elif [[ -z ${A} ]] && ! __has_phase_defined_up_to test; then |
41 |
> cd "${WORKDIR}" |
42 |
> + else |
43 |
> + die "The source directory '${S}' doesn't exist" |
44 |
> fi |
45 |
> |
46 |
> if has test ${RESTRICT} ; then |
47 |
> |
48 |
|
49 |
Looks good. Please merge. |
50 |
-- |
51 |
Thanks, |
52 |
Zac |