commit:     69150409a534e24107cccc080c5650bbd12bcc8e
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 26 23:14:02 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 23:38:35 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=69150409

Allow EPREFIX to be overridden for manipulating prefixed ROOT

* bin/eselect.in: Allow EPREFIX to be overridden for manipulating
prefixed ROOT.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog      | 5 +++++
 bin/eselect.in | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6fcf0db..41d4bab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-26  James Le Cuirot  <[email protected]>
+
+       * bin/eselect.in: Allow EPREFIX to be overridden for manipulating
+       prefixed ROOT.
+
 2022-05-01  Ulrich Müller  <[email protected]>
 
        * misc/eselect-mode.el (eselect-mode): For GNU Emacs, use

diff --git a/bin/eselect.in b/bin/eselect.in
index 4caa87e..6a0fdbc 100755
--- a/bin/eselect.in
+++ b/bin/eselect.in
@@ -41,8 +41,11 @@ ESELECT_VERSION="@VERSION@"
 ESELECT_BINARY_NAME="$0"
 ESELECT_KILL_TARGET="$$"
 
-# Support variables for Gentoo Prefix
-EPREFIX="@EPREFIX@"
+# Support variables for Gentoo Prefix. BROOT is hardcoded as the
+# prefix for the build host. EPREFIX defaults to the same, but can be
+# overridden at runtime when building for a different prefix.
+BROOT="@EPREFIX@"
+: ${EPREFIX="${BROOT}"}
 EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
 
 # Remove all alias definitions. Unset functions and variables that are

Reply via email to