From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, bin/
Date: Tue, 1 May 2018 23:50:32 +0000 (UTC) [thread overview]
Message-ID: <1525218584.4bda6c546aab816e835f62b326db9c2215e182ac.zmedico@gentoo> (raw)
commit: 4bda6c546aab816e835f62b326db9c2215e182ac
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 1 23:37:33 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> 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 <chewi <AT> 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
next reply other threads:[~2018-05-01 23:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-01 23:50 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-01 18:15 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, bin/ Zac Medico
2014-11-14 17:29 Zac Medico
2013-03-21 0:38 Zac Medico
2013-02-10 20:14 Zac Medico
2011-09-07 17:50 Zac Medico
2011-09-05 22:36 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1525218584.4bda6c546aab816e835f62b326db9c2215e182ac.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox