commit: cd2aa636cc5d0476bff29d50fbaab7591b48903e
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 9 20:58:41 2019 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 13:35:32 2019 +0000
URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=cd2aa636
cross-emerge: Default to using no prefix
On non-prefixed systems, cross-emerge installs to /usr/${CHOST} by
default. On prefixed systems, this default effectively becomes
${BROOT}/usr/${CHOST}/${BROOT}, which is unexpected and makes little
sense. The first BROOT originates from the ROOT setting in the cross
make.conf. The second BROOT is the prefix that Portage is configured
to use by default.
We therefore need to avoid the second BROOT by overriding Portage with
a blank EPREFIX value. Note that a bug in Portage itself means that
this is ineffective on versions before 2.3.69 but it's no worse than
it was before either.
For users who do want to set their own EPREFIX, the PORTAGE_CONFIGROOT
default has been updated to ${SYSROOT}${EPREFIX} as the prefixed
location is required for this variable. This is despite man emerge
suggesting otherwise!
Closes: https://bugs.gentoo.org/642604
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
wrappers/cross-emerge | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/wrappers/cross-emerge b/wrappers/cross-emerge
index 7b63756..a85d41e 100755
--- a/wrappers/cross-emerge
+++ b/wrappers/cross-emerge
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2008-2011 Gentoo Foundation
+# Copyright 2008-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
if [ -z "${CHOST}" ] ; then
@@ -9,14 +9,15 @@ if [ -z "${CHOST}" ] ; then
fi
export CHOST
-EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
-if [ "${EPREFIX}" = "@"GENTOO_PORTAGE_EPREFIX"@" ] ; then
- EPREFIX=""
+BROOT="@GENTOO_PORTAGE_EPREFIX@"
+if [ "${BROOT}" = "@"GENTOO_PORTAGE_EPREFIX"@" ] ; then
+ BROOT=""
fi
-: ${SYSROOT=${EPREFIX}/usr/${CHOST}}
-: ${PORTAGE_CONFIGROOT=${SYSROOT}}
-export SYSROOT PORTAGE_CONFIGROOT
+: ${EPREFIX=}
+: ${SYSROOT=${BROOT}/usr/${CHOST}}
+: ${PORTAGE_CONFIGROOT=${SYSROOT}${EPREFIX}}
+export EPREFIX SYSROOT PORTAGE_CONFIGROOT
if [ -z "${CHOST}" ] || [ ! -d "${SYSROOT}" ] ; then
echo "cross-emerge: CHOST is not set properly"