Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, bin/
Date: Tue, 01 May 2018 23:50:37
Message-Id: 1525218584.4bda6c546aab816e835f62b326db9c2215e182ac.zmedico@gentoo
1 commit: 4bda6c546aab816e835f62b326db9c2215e182ac
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 1 23:37:33 2018 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue May 1 23:49:44 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4bda6c54
7
8 Revert "phase-helpers.sh: fix best/has_version -b for cross-prefix"
9
10 This reverts commit a0ac6e6727abec8d2482c95b1e84d8df24d78619,
11 since BROOT is only supposed to be set in src_* phases.
12 Update SimpleEmergeTestCase to call best/has_version -b only
13 in src_install for EAPI 7.
14
15 Reported-by: James Le Cuirot <chewi <AT> gentoo.org>
16
17 bin/phase-helpers.sh | 2 +-
18 pym/portage/tests/emerge/test_simple.py | 23 ++++++++++++++++++++---
19 2 files changed, 21 insertions(+), 4 deletions(-)
20
21 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
22 index 8b16d7d31..59c19cf67 100644
23 --- a/bin/phase-helpers.sh
24 +++ b/bin/phase-helpers.sh
25 @@ -912,7 +912,7 @@ ___best_version_and_has_version_common() {
26 case ${root_arg} in
27 -r) root=${EROOT} ;;
28 -d) root=${ESYSROOT} ;;
29 - -b) root=${BROOT:-/${PORTAGE_OVERRIDE_EPREFIX#/}} ;;
30 + -b) root=${BROOT:-/} ;;
31 esac
32 else
33 case ${root_arg} in
34
35 diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
36 index 204c23296..b1402ddd5 100644
37 --- a/pym/portage/tests/emerge/test_simple.py
38 +++ b/pym/portage/tests/emerge/test_simple.py
39 @@ -58,6 +58,8 @@ src_install() {
40 echo "blah blah blah" > "${T}"/latin-1-$(printf "\\xa9")-regular-file || die
41 doins "${T}"/latin-1-$(printf "\\xa9")-regular-file
42 dosym latin-1-$(printf "\\xa9")-regular-file ${latin_1_dir}/latin-1-$(printf "\\xa9")-symlink || die
43 +
44 + call_has_and_best_version
45 }
46
47 pkg_config() {
48 @@ -69,14 +71,29 @@ pkg_info() {
49 }
50
51 pkg_preinst() {
52 + if ! ___eapi_best_version_and_has_version_support_-b_-d_-r; then
53 + # The BROOT variable is unset during pkg_* phases for EAPI 7,
54 + # therefore best/has_version -b is expected to fail if we attempt
55 + # to call it for EAPI 7 here.
56 + call_has_and_best_version
57 + fi
58 +}
59 +
60 +call_has_and_best_version() {
61 local root_arg
62 if ___eapi_best_version_and_has_version_support_-b_-d_-r; then
63 root_arg="-b"
64 else
65 root_arg="--host-root"
66 fi
67 - einfo "called pkg_preinst for $CATEGORY/$PF"
68 -
69 + einfo "called ${EBUILD_PHASE_FUNC} for $CATEGORY/$PF"
70 + einfo "EPREFIX=${EPREFIX}"
71 + einfo "PORTAGE_OVERRIDE_EPREFIX=${PORTAGE_OVERRIDE_EPREFIX}"
72 + einfo "ROOT=${ROOT}"
73 + einfo "EROOT=${EROOT}"
74 + einfo "SYSROOT=${SYSROOT}"
75 + einfo "ESYSROOT=${ESYSROOT}"
76 + einfo "BROOT=${BROOT}"
77 # Test that has_version and best_version work correctly with
78 # prefix (involves internal ROOT -> EROOT calculation in order
79 # to support ROOT override via the environment with EAPIs 3
80 @@ -90,7 +107,7 @@ pkg_preinst() {
81 if [[ ${EPREFIX} != ${PORTAGE_OVERRIDE_EPREFIX} ]] ; then
82 if has_version ${root_arg} $CATEGORY/$PN:$SLOT ; then
83 einfo "has_version ${root_arg} detects an installed instance of $CATEGORY/$PN:$SLOT"
84 - einfo "best_version ${root_arg} reports that the installed instance is $(best_version $CATEGORY/$PN:$SLOT)"
85 + einfo "best_version ${root_arg} reports that the installed instance is $(best_version ${root_arg} $CATEGORY/$PN:$SLOT)"
86 else
87 einfo "has_version ${root_arg} does not detect an installed instance of $CATEGORY/$PN:$SLOT"
88 fi