Add an additional conditional to the dosym Prefix hack to ensure that the symlink is not using double Prefix when the ebuild uses ${EPREFIX} explicitly. This ensures that Portage on Prefix systems is both compatible with the ebuilds relying on the hack, and using dosym in the PMS-defined manner. --- bin/ebuild-helpers/dosym | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym index 0bc8cc7be..5741da346 100755 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 @@ -21,9 +21,12 @@ fi destdir=${2%/*} [[ ! -d ${ED}${destdir} ]] && dodir "${destdir}" -# when absolute, prefix with offset for Gentoo Prefix target="${1}" -[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}" +# DEPRECATED HACK: when absolute, prefix with offset for Gentoo Prefix +# (but only if ${EPREFIX} is not there already) +if [[ ${target:0:1} == "/" && ${target} != "${EPREFIX}"* ]]; then + target="${EPREFIX}${target}" +fi ln -snf "${target}" "${ED}${2}" ret=$? -- 2.12.2