commit:     cfa3149797c2204f3a156ec2909c444baa640a6b
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  6 09:40:02 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug  6 22:28:50 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cfa31497

Define BROOT in pkg_* phases following PMS change

Closes: https://bugs.gentoo.org/911797
Bug: https://bugs.gentoo.org/911574
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1077
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                 | 3 +++
 bin/phase-helpers.sh                 | 4 ++--
 lib/portage/package/ebuild/config.py | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 53db165e8..53f0f921f 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ portage-3.0.50 (UNRELEASED)
 
 Breaking changes:
 * The minimum supported Python version is now >= Python 3.9.
+
 * Portage now installed with Meson and Python sdist + wheel now prepared with
   meson-python for PEP 517 compliance.
 
@@ -23,6 +24,8 @@ Bug fixes:
 * Use the correct Python library path when launching scripts directly from a
   virtual environment.
 
+* Define BROOT in pkg_* phases following PMS change.
+
 portage-3.0.49 (2023-06-21)
 --------------
 

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f1b762b0a..3f12b3707 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -945,8 +945,8 @@ ___best_version_and_has_version_common() {
                                        -r) root=${ROOT%/}/${EPREFIX#/} ;;
                                        -d) root=${ESYSROOT:-/} ;;
                                        -b)
-                                               # Use 
/${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
-                                               # to BROOT, except BROOT is 
only defined in src_* phases.
+                                               # Use 
/${PORTAGE_OVERRIDE_EPREFIX#/} to support older
+                                               # EAPIs, as it is equivalent to 
BROOT.
                                                
root=/${PORTAGE_OVERRIDE_EPREFIX#/}
                                                cmd+=(env 
EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
                                                ;;

diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index 91303d7ad..e07d27e8f 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -3338,7 +3338,7 @@ class config:
         if not (src_like_phase and eapi_attrs.sysroot):
             mydict.pop("ESYSROOT", None)
 
-        if not (src_like_phase and eapi_attrs.broot):
+        if not eapi_attrs.broot:
             mydict.pop("BROOT", None)
 
         if phase == "depend" or (

Reply via email to