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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym index 0bc8cc7be..11596403f 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,15 @@ 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) +# this will eventually be removed, #615594 +if [[ ${target:0:1} == "/" && ${target}/ != "${EPREFIX}"/* ]]; then + eqawarn "dosym: prepending EPREFIX to path implicitly. If this is desired," + eqawarn " please fix the ebuild to use \${EPREFIX} explicitly." + target="${EPREFIX}${target}" +fi ln -snf "${target}" "${ED}${2}" ret=$? -- 2.12.2