From 9c28a2d155a6aecb9e1b227778ccde8e6349233d Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Tue, 9 Jul 2019 21:58:41 +0100 Subject: 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 --- wrappers/cross-emerge | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'wrappers/cross-emerge') 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" -- cgit v1.2.3-65-gdbad