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 67E311382C5 for ; Tue, 1 May 2018 23:50:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E7A9E08BB; Tue, 1 May 2018 23:50:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 08D36E08BB for ; Tue, 1 May 2018 23:50:35 +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 36A7B335C79 for ; Tue, 1 May 2018 23:50:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8887F281 for ; Tue, 1 May 2018 23:50:32 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1525218584.4bda6c546aab816e835f62b326db9c2215e182ac.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-helpers.sh pym/portage/tests/emerge/test_simple.py X-VCS-Directories: bin/ pym/portage/tests/emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4bda6c546aab816e835f62b326db9c2215e182ac X-VCS-Branch: master Date: Tue, 1 May 2018 23:50:32 +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-Archives-Salt: ddef7777-4345-46e0-9cb4-ee78bbafb680 X-Archives-Hash: 3cc619a1cdf58dec0d50886f534ed8c4 commit: 4bda6c546aab816e835f62b326db9c2215e182ac Author: Zac Medico gentoo org> AuthorDate: Tue May 1 23:37:33 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue May 1 23:49:44 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4bda6c54 Revert "phase-helpers.sh: fix best/has_version -b for cross-prefix" This reverts commit a0ac6e6727abec8d2482c95b1e84d8df24d78619, since BROOT is only supposed to be set in src_* phases. Update SimpleEmergeTestCase to call best/has_version -b only in src_install for EAPI 7. Reported-by: James Le Cuirot gentoo.org> bin/phase-helpers.sh | 2 +- pym/portage/tests/emerge/test_simple.py | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 8b16d7d31..59c19cf67 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -912,7 +912,7 @@ ___best_version_and_has_version_common() { case ${root_arg} in -r) root=${EROOT} ;; -d) root=${ESYSROOT} ;; - -b) root=${BROOT:-/${PORTAGE_OVERRIDE_EPREFIX#/}} ;; + -b) root=${BROOT:-/} ;; esac else case ${root_arg} in diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py index 204c23296..b1402ddd5 100644 --- a/pym/portage/tests/emerge/test_simple.py +++ b/pym/portage/tests/emerge/test_simple.py @@ -58,6 +58,8 @@ src_install() { echo "blah blah blah" > "${T}"/latin-1-$(printf "\\xa9")-regular-file || die doins "${T}"/latin-1-$(printf "\\xa9")-regular-file dosym latin-1-$(printf "\\xa9")-regular-file ${latin_1_dir}/latin-1-$(printf "\\xa9")-symlink || die + + call_has_and_best_version } pkg_config() { @@ -69,14 +71,29 @@ pkg_info() { } pkg_preinst() { + if ! ___eapi_best_version_and_has_version_support_-b_-d_-r; then + # The BROOT variable is unset during pkg_* phases for EAPI 7, + # therefore best/has_version -b is expected to fail if we attempt + # to call it for EAPI 7 here. + call_has_and_best_version + fi +} + +call_has_and_best_version() { local root_arg if ___eapi_best_version_and_has_version_support_-b_-d_-r; then root_arg="-b" else root_arg="--host-root" fi - einfo "called pkg_preinst for $CATEGORY/$PF" - + einfo "called ${EBUILD_PHASE_FUNC} for $CATEGORY/$PF" + einfo "EPREFIX=${EPREFIX}" + einfo "PORTAGE_OVERRIDE_EPREFIX=${PORTAGE_OVERRIDE_EPREFIX}" + einfo "ROOT=${ROOT}" + einfo "EROOT=${EROOT}" + einfo "SYSROOT=${SYSROOT}" + einfo "ESYSROOT=${ESYSROOT}" + einfo "BROOT=${BROOT}" # Test that has_version and best_version work correctly with # prefix (involves internal ROOT -> EROOT calculation in order # to support ROOT override via the environment with EAPIs 3 @@ -90,7 +107,7 @@ pkg_preinst() { if [[ ${EPREFIX} != ${PORTAGE_OVERRIDE_EPREFIX} ]] ; then if has_version ${root_arg} $CATEGORY/$PN:$SLOT ; then einfo "has_version ${root_arg} detects an installed instance of $CATEGORY/$PN:$SLOT" - einfo "best_version ${root_arg} reports that the installed instance is $(best_version $CATEGORY/$PN:$SLOT)" + einfo "best_version ${root_arg} reports that the installed instance is $(best_version ${root_arg} $CATEGORY/$PN:$SLOT)" else einfo "has_version ${root_arg} does not detect an installed instance of $CATEGORY/$PN:$SLOT" fi