Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] dosym: protect Prefix hack from double EPREFIX
Date: Wed, 19 Apr 2017 13:43:46
Message-Id: 20170419134333.20881-1-mgorny@gentoo.org
1 Add an additional conditional to the dosym Prefix hack to ensure that
2 the symlink is not using double Prefix when the ebuild uses ${EPREFIX}
3 explicitly. This ensures that Portage on Prefix systems is both
4 compatible with the ebuilds relying on the hack, and using dosym
5 in the PMS-defined manner.
6 ---
7 bin/ebuild-helpers/dosym | 9 ++++++---
8 1 file changed, 6 insertions(+), 3 deletions(-)
9
10 diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
11 index 0bc8cc7be..5741da346 100755
12 --- a/bin/ebuild-helpers/dosym
13 +++ b/bin/ebuild-helpers/dosym
14 @@ -1,5 +1,5 @@
15 #!/bin/bash
16 -# Copyright 1999-2012 Gentoo Foundation
17 +# Copyright 1999-2017 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19
20 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
21 @@ -21,9 +21,12 @@ fi
22
23 destdir=${2%/*}
24 [[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
25 -# when absolute, prefix with offset for Gentoo Prefix
26 target="${1}"
27 -[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
28 +# DEPRECATED HACK: when absolute, prefix with offset for Gentoo Prefix
29 +# (but only if ${EPREFIX} is not there already)
30 +if [[ ${target:0:1} == "/" && ${target} != "${EPREFIX}"* ]]; then
31 + target="${EPREFIX}${target}"
32 +fi
33 ln -snf "${target}" "${ED}${2}"
34
35 ret=$?
36 --
37 2.12.2

Replies