Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] dosym: protect Prefix hack from double EPREFIX
Date: Wed, 19 Apr 2017 16:29:48
Message-Id: 1492619378.1102.1.camel@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] dosym: protect Prefix hack from double EPREFIX by Ulrich Mueller
1 On śro, 2017-04-19 at 18:06 +0200, Ulrich Mueller wrote:
2 > > > > > > On Wed, 19 Apr 2017, Michał Górny wrote:
3 > > Add an additional conditional to the dosym Prefix hack to ensure that
4 > > the symlink is not using double Prefix when the ebuild uses ${EPREFIX}
5 > > explicitly. This ensures that Portage on Prefix systems is both
6 > > compatible with the ebuilds relying on the hack, and using dosym
7 > > in the PMS-defined manner.
8 >
9 >
10 >
11 > > destdir=${2%/*}
12 > > [[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
13 > > -# when absolute, prefix with offset for Gentoo Prefix
14 > > target="${1}"
15 > > -[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
16 > > +# DEPRECATED HACK: when absolute, prefix with offset for Gentoo Prefix
17 > > +# (but only if ${EPREFIX} is not there already)
18 >
19 > Maybe add a date (like 2018-04-30) to the comment after which the code
20 > can be removed?
21
22 I'd rather not force any specific dates, considering the main condition
23 is to fix the ebuilds relying on it. Maybe a bug number instead?
24
25 >
26 > > +if [[ ${target:0:1} == "/" && ${target} != "${EPREFIX}"* ]]; then
27 >
28 > I think you want an additional slash in the second condition, in order
29 > to prevent /foo/barbaz from matching if EPREFIX is equal to /foo/bar:
30 >
31 > if [[ ${target:0:1} == "/" && ${target}/ != "${EPREFIX}"/* ]]; then
32
33 Makes sense, I'll do that.
34
35 >
36 > > + target="${EPREFIX}${target}"
37 > > +fi
38 > > ln -snf "${target}" "${ED}${2}"
39 > >
40 > > ret=$?
41 >
42 > Ulrich
43
44 --
45 Best regards,
46 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature