aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2019-07-09 21:58:41 +0100
committerJames Le Cuirot <chewi@gentoo.org>2019-07-21 14:35:32 +0100
commitcd2aa636cc5d0476bff29d50fbaab7591b48903e (patch)
tree03ea6b4f8e1fefd43a309aa3531c61087113d18b /wrappers/cross-emerge
parentwrappers: tweak rarning message to contain config file paths (diff)
downloadcrossdev-cd2aa636cc5d0476bff29d50fbaab7591b48903e.tar.gz
crossdev-cd2aa636cc5d0476bff29d50fbaab7591b48903e.tar.bz2
crossdev-cd2aa636cc5d0476bff29d50fbaab7591b48903e.zip
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@gentoo.org>
Diffstat (limited to 'wrappers/cross-emerge')
-rwxr-xr-xwrappers/cross-emerge15
1 files 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"