From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C753A138334 for ; Tue, 19 Mar 2019 01:20:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A9E83E087E; Tue, 19 Mar 2019 01:20:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7CBDCE087E for ; Tue, 19 Mar 2019 01:20:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 13FEF335CC1 for ; Tue, 19 Mar 2019 01:20:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 67D61566 for ; Tue, 19 Mar 2019 01:20:50 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1552958317.06086354fdd66fdf84c812f4be1757cb96e16c45.ulm@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 06086354fdd66fdf84c812f4be1757cb96e16c45 X-VCS-Branch: master Date: Tue, 19 Mar 2019 01:20:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 90a6ff75-eb14-488a-b4d2-bf0e0ae255ad X-Archives-Hash: 7c1760edae5292ee61e3338a7ed6310f commit: 06086354fdd66fdf84c812f4be1757cb96e16c45 Author: Ulrich Müller gentoo org> AuthorDate: Sat Mar 9 08:16:17 2019 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Mar 19 01:18:37 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=06086354 __dyn_test: Make fallback to WORKDIR conditional. When the fallback from S to WORKDIR was made conditional in EAPI 4, src_test() was originally omitted. This has been fixed retroactively in PMS: https://gitweb.gentoo.org/proj/pms.git/commit/?id=0038f90a942f0856ae2533b26f709002a3ec80ae There should be no issues with backwards compatibility of existing ebuilds. The feature is not used in the Gentoo repository. Plus, the scenario is very unlikely, because in src_test the fallback to WORKDIR could only happen for an ebuild that: - Has no files in A to be unpacked. - Doesn't define any of the unpack, prepare, configure, compile or install phases (otherwise it would die in one of these phases). Acked-by: Zac Medico gentoo.org> Signed-off-by: Ulrich Müller gentoo.org> bin/phase-functions.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index d8ebf3d3e..ee07ea0f9 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Hardcoded bash lists are needed for backward compatibility with @@ -358,7 +358,7 @@ __abort_install() { __has_phase_defined_up_to() { local phase - for phase in unpack prepare configure compile install; do + for phase in unpack prepare configure compile test install; do has ${phase} ${DEFINED_PHASES} && return 0 [[ ${phase} == $1 ]] && return 1 done @@ -495,10 +495,14 @@ __dyn_test() { trap "__abort_test" SIGINT SIGQUIT __start_distcc - if [ -d "${S}" ]; then + if [[ -d ${S} ]]; then cd "${S}" - else + elif ___eapi_has_S_WORKDIR_fallback; then + cd "${WORKDIR}" + elif [[ -z ${A} ]] && ! __has_phase_defined_up_to test; then cd "${WORKDIR}" + else + die "The source directory '${S}' doesn't exist" fi if has test ${RESTRICT} ; then