Gentoo Archives: gentoo-portage-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies