diff options
author | James Le Cuirot <chewi@gentoo.org> | 2019-07-09 21:58:41 +0100 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2019-07-09 22:16:57 +0100 |
commit | 9c28a2d155a6aecb9e1b227778ccde8e6349233d (patch) | |
tree | eedbfb5a84e3594cf8859abd088867f88f4b0df6 | |
parent | crossdev: disable USE=hardened by default on bare-metal (diff) | |
download | crossdev-bug_642604.tar.gz crossdev-bug_642604.tar.bz2 crossdev-bug_642604.zip |
cross-emerge: Default to using no prefixbug_642604
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>
-rwxr-xr-x | wrappers/cross-emerge | 15 |
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" |