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 1/2] Fix uses of D/ED to account for no trailing slash
Date: Sun, 11 Mar 2018 13:55:04
Message-Id: 20180311135455.9112-1-mgorny@gentoo.org
1 Fix all uses of D/ED to account for trailing slash not being present
2 in EAPI 7. While at it, also remove some duplicate slashes.
3 ---
4 bin/ebuild-helpers/dobin | 6 +++---
5 bin/ebuild-helpers/dodir | 4 ++--
6 bin/ebuild-helpers/dodoc | 2 +-
7 bin/ebuild-helpers/doexe | 8 ++++----
8 bin/ebuild-helpers/dohard | 6 +++---
9 bin/ebuild-helpers/doinfo | 8 ++++----
10 bin/ebuild-helpers/doins | 2 +-
11 bin/ebuild-helpers/dolib | 2 +-
12 bin/ebuild-helpers/doman | 8 ++++----
13 bin/ebuild-helpers/domo | 6 +++---
14 bin/ebuild-helpers/dosbin | 6 +++---
15 bin/ebuild-helpers/dosed | 4 ++--
16 bin/ebuild-helpers/dosym | 8 ++++----
17 bin/ebuild-helpers/ecompressdir | 25 ++++++++++++-----------
18 bin/ebuild-helpers/fowners | 4 ++--
19 bin/ebuild-helpers/fperms | 4 ++--
20 bin/ebuild-helpers/keepdir | 6 +++---
21 bin/ebuild-helpers/prepalldocs | 4 ++--
22 bin/ebuild-helpers/prepallinfo | 4 ++--
23 bin/ebuild-helpers/prepinfo | 12 +++++------
24 bin/ebuild-helpers/prepman | 10 ++++-----
25 bin/ebuild-helpers/prepstrip | 16 +++++++--------
26 bin/install-qa-check.d/60udev | 6 +++---
27 bin/install-qa-check.d/80libraries | 22 ++++++++++----------
28 bin/misc-functions.sh | 24 +++++++++++-----------
29 bin/phase-helpers.sh | 42 +++++++++++++++++++-------------------
30 26 files changed, 125 insertions(+), 124 deletions(-)
31
32 diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin
33 index f43871f49..975067fb1 100755
34 --- a/bin/ebuild-helpers/dobin
35 +++ b/bin/ebuild-helpers/dobin
36 @@ -21,15 +21,15 @@ else
37 _E_DESTTREE_=${DESTTREE}
38 fi
39
40 -if [[ ! -d ${ED}${_E_DESTTREE_}/bin ]] ; then
41 - install -d "${ED}${_E_DESTTREE_}/bin" || { __helpers_die "${0##*/}: failed to install ${ED}${_E_DESTTREE_}/bin"; exit 2; }
42 +if [[ ! -d ${ED%/}/${_E_DESTTREE_#/}/bin ]] ; then
43 + install -d "${ED%/}/${_E_DESTTREE_#/}/bin" || { __helpers_die "${0##*/}: failed to install ${ED%/}/${_E_DESTTREE_#/}/bin"; exit 2; }
44 fi
45
46 ret=0
47
48 for x in "$@" ; do
49 if [[ -e ${x} ]] ; then
50 - install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${_E_DESTTREE_}/bin"
51 + install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED%/}/${_E_DESTTREE_#/}/bin"
52 else
53 echo "!!! ${0##*/}: $x does not exist" 1>&2
54 false
55 diff --git a/bin/ebuild-helpers/dodir b/bin/ebuild-helpers/dodir
56 index eed2c8b8f..9b376c73f 100755
57 --- a/bin/ebuild-helpers/dodir
58 +++ b/bin/ebuild-helpers/dodir
59 @@ -1,5 +1,5 @@
60 #!/bin/bash
61 -# Copyright 1999-2012 Gentoo Foundation
62 +# Copyright 1999-2018 Gentoo Foundation
63 # Distributed under the terms of the GNU General Public License v2
64
65 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
66 @@ -8,7 +8,7 @@ if ! ___eapi_has_prefix_variables; then
67 ED=${D}
68 fi
69
70 -install -d ${DIROPTIONS} "${@/#/${ED}/}"
71 +install -d ${DIROPTIONS} "${@/#/${ED%/}/}"
72 ret=$?
73 [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
74 exit $ret
75 diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc
76 index 75029eb20..84936e400 100755
77 --- a/bin/ebuild-helpers/dodoc
78 +++ b/bin/ebuild-helpers/dodoc
79 @@ -17,7 +17,7 @@ if ! ___eapi_has_prefix_variables; then
80 ED=${D}
81 fi
82
83 -dir="${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
84 +dir="${ED%/}/usr/share/doc/${PF}/${_E_DOCDESTTREE_#/}"
85 if [ ! -d "${dir}" ] ; then
86 install -d "${dir}"
87 fi
88 diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe
89 index 8c4b9e97c..152c13bf6 100755
90 --- a/bin/ebuild-helpers/doexe
91 +++ b/bin/ebuild-helpers/doexe
92 @@ -1,5 +1,5 @@
93 #!/bin/bash
94 -# Copyright 1999-2012 Gentoo Foundation
95 +# Copyright 1999-2018 Gentoo Foundation
96 # Distributed under the terms of the GNU General Public License v2
97
98 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
99 @@ -13,8 +13,8 @@ if ! ___eapi_has_prefix_variables; then
100 ED=${D}
101 fi
102
103 -if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
104 - install -d "${ED}${_E_EXEDESTTREE_}"
105 +if [[ ! -d ${ED%/}/${_E_EXEDESTTREE_#/} ]] ; then
106 + install -d "${ED%/}/${_E_EXEDESTTREE_#/}"
107 fi
108
109 TMP=$(mktemp -d "${T}/.doexe_tmp_XXXXXX")
110 @@ -32,7 +32,7 @@ for x in "$@" ; do
111 mysrc="${x}"
112 fi
113 if [ -e "$mysrc" ] ; then
114 - install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_"
115 + install ${EXEOPTIONS} "$mysrc" "${ED%/}/${_E_EXEDESTTREE_#/}"
116 else
117 echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
118 false
119 diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard
120 index 8a93fad4f..66e2604b0 100755
121 --- a/bin/ebuild-helpers/dohard
122 +++ b/bin/ebuild-helpers/dohard
123 @@ -1,5 +1,5 @@
124 #!/bin/bash
125 -# Copyright 1999-2012 Gentoo Foundation
126 +# Copyright 1999-2018 Gentoo Foundation
127 # Distributed under the terms of the GNU General Public License v2
128
129 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
130 @@ -19,6 +19,6 @@ if ! ___eapi_has_prefix_variables; then
131 fi
132
133 destdir=${2%/*}
134 -[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
135 +[[ ! -d ${ED%/}/${destdir#/} ]] && dodir "${destdir}"
136
137 -exec ln -f "${ED}$1" "${ED}$2"
138 +exec ln -f "${ED%/}/${1#/}" "${ED%/}/${2#/}"
139 diff --git a/bin/ebuild-helpers/doinfo b/bin/ebuild-helpers/doinfo
140 index 24b5ddd89..30a38e055 100755
141 --- a/bin/ebuild-helpers/doinfo
142 +++ b/bin/ebuild-helpers/doinfo
143 @@ -1,5 +1,5 @@
144 #!/bin/bash
145 -# Copyright 1999-2012 Gentoo Foundation
146 +# Copyright 1999-2018 Gentoo Foundation
147 # Distributed under the terms of the GNU General Public License v2
148
149 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
150 @@ -13,11 +13,11 @@ if ! ___eapi_has_prefix_variables; then
151 ED=${D}
152 fi
153
154 -if [[ ! -d ${ED}usr/share/info ]] ; then
155 - install -d "${ED}usr/share/info" || { __helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
156 +if [[ ! -d ${ED%/}/usr/share/info ]] ; then
157 + install -d "${ED%/}/usr/share/info" || { __helpers_die "${0##*/}: failed to install ${ED%/}/usr/share/info"; exit 1; }
158 fi
159
160 -install -m0644 "$@" "${ED}usr/share/info"
161 +install -m0644 "$@" "${ED%/}/usr/share/info"
162 rval=$?
163 if [ $rval -ne 0 ] ; then
164 for x in "$@" ; do
165 diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
166 index 327d409a4..fb5fc7c7c 100755
167 --- a/bin/ebuild-helpers/doins
168 +++ b/bin/ebuild-helpers/doins
169 @@ -83,7 +83,7 @@ fi
170
171 DOINS_ARGS+=(
172 "--helper=${helper}"
173 - "--dest=${ED}${_E_INSDESTTREE_}"
174 + "--dest=${ED%/}/${_E_INSDESTTREE_#/}"
175 )
176
177 # Explicitly set PYTHONPATH to non empty.
178 diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib
179 index 2800fad76..bd8eebca7 100755
180 --- a/bin/ebuild-helpers/dolib
181 +++ b/bin/ebuild-helpers/dolib
182 @@ -29,7 +29,7 @@ fi
183 unset LIBDIR_VAR
184 # we need this to default to lib so that things dont break
185 CONF_LIBDIR=${CONF_LIBDIR:-lib}
186 -libdir="${ED}${_E_DESTTREE_}/${CONF_LIBDIR}"
187 +libdir="${ED%/}/${_E_DESTTREE_#/}/${CONF_LIBDIR}"
188
189
190 if [[ $# -lt 1 ]] ; then
191 diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman
192 index 43d29f22e..9cfc89df0 100755
193 --- a/bin/ebuild-helpers/doman
194 +++ b/bin/ebuild-helpers/doman
195 @@ -1,5 +1,5 @@
196 #!/bin/bash
197 -# Copyright 1999-2012 Gentoo Foundation
198 +# Copyright 1999-2018 Gentoo Foundation
199 # Distributed under the terms of the GNU General Public License v2
200
201 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
202 @@ -49,11 +49,11 @@ for x in "$@" ; do
203
204 if [[ ${mandir} == *man[0-9n] ]] ; then
205 if [[ -s ${x} ]] ; then
206 - if [[ ! -d ${ED}/usr/share/man/${mandir} ]] ; then
207 - install -d "${ED}/usr/share/man/${mandir}"
208 + if [[ ! -d ${ED%/}/usr/share/man/${mandir} ]] ; then
209 + install -d "${ED%/}/usr/share/man/${mandir}"
210 fi
211
212 - install -m0644 "${x}" "${ED}/usr/share/man/${mandir}/${name}"
213 + install -m0644 "${x}" "${ED%/}/usr/share/man/${mandir}/${name}"
214 ((ret|=$?))
215 elif [[ ! -e ${x} ]] ; then
216 echo "!!! ${0##*/}: $x does not exist" 1>&2
217 diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo
218 index 70f93d61e..2e95eb751 100755
219 --- a/bin/ebuild-helpers/domo
220 +++ b/bin/ebuild-helpers/domo
221 @@ -27,8 +27,8 @@ if ! ___eapi_domo_respects_into; then
222 _E_DESTTREE_=/usr
223 fi
224
225 -if [ ! -d "${ED}${_E_DESTTREE_}/share/locale" ] ; then
226 - install -d "${ED}${_E_DESTTREE_}/share/locale/"
227 +if [ ! -d "${ED%/}/${_E_DESTTREE_#/}/share/locale" ] ; then
228 + install -d "${ED%/}/${_E_DESTTREE_#/}/share/locale/"
229 fi
230
231 ret=0
232 @@ -36,7 +36,7 @@ ret=0
233 for x in "$@" ; do
234 if [ -e "${x}" ] ; then
235 mytiny="${x##*/}"
236 - mydir="${ED}${_E_DESTTREE_}/share/locale/${mytiny%.*}/LC_MESSAGES"
237 + mydir="${ED%/}/${_E_DESTTREE_#/}/share/locale/${mytiny%.*}/LC_MESSAGES"
238 if [ ! -d "${mydir}" ] ; then
239 install -d "${mydir}"
240 fi
241 diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin
242 index f698f6fbb..ac0ab37ca 100755
243 --- a/bin/ebuild-helpers/dosbin
244 +++ b/bin/ebuild-helpers/dosbin
245 @@ -21,15 +21,15 @@ else
246 _E_DESTTREE_=${DESTTREE}
247 fi
248
249 -if [[ ! -d ${ED}${_E_DESTTREE_}/sbin ]] ; then
250 - install -d "${ED}${_E_DESTTREE_}/sbin" || { __helpers_die "${0##*/}: failed to install ${ED}${_E_DESTTREE_}/sbin"; exit 2; }
251 +if [[ ! -d ${ED%/}/${_E_DESTTREE_#/}/sbin ]] ; then
252 + install -d "${ED%/}/${_E_DESTTREE_#/}/sbin" || { __helpers_die "${0##*/}: failed to install ${ED%/}/${_E_DESTTREE_#/}/sbin"; exit 2; }
253 fi
254
255 ret=0
256
257 for x in "$@" ; do
258 if [[ -e ${x} ]] ; then
259 - install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${_E_DESTTREE_}/sbin"
260 + install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED%/}/${_E_DESTTREE_#/}/sbin"
261 else
262 echo "!!! ${0##*/}: ${x} does not exist" 1>&2
263 false
264 diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed
265 index 1e10d129d..37c8a29d3 100755
266 --- a/bin/ebuild-helpers/dosed
267 +++ b/bin/ebuild-helpers/dosed
268 @@ -1,5 +1,5 @@
269 #!/bin/bash
270 -# Copyright 1999-2012 Gentoo Foundation
271 +# Copyright 1999-2018 Gentoo Foundation
272 # Distributed under the terms of the GNU General Public License v2
273
274 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
275 @@ -23,7 +23,7 @@ file_found=0
276 mysed="s:${ED}::g"
277
278 for x in "$@" ; do
279 - y=$ED${x#/}
280 + y=${ED%/}/${x#/}
281 if [ -e "${y}" ] ; then
282 if [ -f "${y}" ] ; then
283 file_found=1
284 diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
285 index e96039146..d5a651bf5 100755
286 --- a/bin/ebuild-helpers/dosym
287 +++ b/bin/ebuild-helpers/dosym
288 @@ -1,5 +1,5 @@
289 #!/bin/bash
290 -# Copyright 1999-2017 Gentoo Foundation
291 +# Copyright 1999-2018 Gentoo Foundation
292 # Distributed under the terms of the GNU General Public License v2
293
294 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
295 @@ -13,13 +13,13 @@ if ! ___eapi_has_prefix_variables; then
296 ED=${D}
297 fi
298
299 -if [[ ${2} == */ ]] || [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
300 +if [[ ${2} == */ ]] || [[ -d ${ED%/}/${2#/} && ! -L ${ED%/}/${2#/} ]] ; then
301 # implicit basename not allowed by PMS (bug #379899)
302 __helpers_die "${0##*/}: dosym target omits basename: '${2}'"
303 fi
304
305 destdir=${2%/*}
306 -[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
307 +[[ ! -d ${ED%/}/${destdir#/} ]] && dodir "${destdir}"
308 target="${1}"
309 # DEPRECATED HACK: when absolute, prefix with offset for Gentoo Prefix
310 # (but only if ${EPREFIX} is not there already)
311 @@ -29,7 +29,7 @@ if [[ ${target:0:1} == "/" && ${target}/ != "${EPREFIX}"/* ]]; then
312 eqawarn " please fix the ebuild to use \${EPREFIX} explicitly."
313 target="${EPREFIX}${target}"
314 fi
315 -ln -snf "${target}" "${ED}${2}"
316 +ln -snf "${target}" "${ED%/}/${2#/}"
317
318 ret=$?
319 [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
320 diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir
321 index 4f57262e9..fb4c39f2b 100755
322 --- a/bin/ebuild-helpers/ecompressdir
323 +++ b/bin/ebuild-helpers/ecompressdir
324 @@ -1,5 +1,5 @@
325 #!/bin/bash
326 -# Copyright 1999-2013 Gentoo Foundation
327 +# Copyright 1999-2018 Gentoo Foundation
328 # Distributed under the terms of the GNU General Public License v2
329
330 source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1
331 @@ -19,15 +19,16 @@ while [[ $# -gt 0 ]] ; do
332 --ignore)
333 shift
334 for skip in "$@" ; do
335 - [[ -d ${ED}${skip} || -f ${ED}${skip} ]] \
336 - && >> "${ED}${skip}.ecompress.skip"
337 + [[ -d ${ED%/}/${skip#/} || -f ${ED%/}/${skip#/} ]] \
338 + && >> "${ED%/}/${skip#/}.ecompress.skip"
339 done
340 exit 0
341 ;;
342 --queue)
343 shift
344 + set -- "${@#/}"
345 set -- "${@/%/.ecompress.dir}"
346 - set -- "${@/#/${ED}}"
347 + set -- "${@/#/${ED%/}/}"
348 ret=0
349 for x in "$@" ; do
350 # Stash the limit in the .dir file so we can reload it later.
351 @@ -40,7 +41,7 @@ while [[ $# -gt 0 ]] ; do
352 --dequeue)
353 [[ -n $2 ]] && __vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
354 find "${ED}" -name '*.ecompress.dir' -print0 \
355 - | sed -e 's:\.ecompress\.dir::g' -e "s:${ED}:/:g" \
356 + | sed -e 's:\.ecompress\.dir::g' -e "s:${ED%/}::g" \
357 | ${XARGS} -0 ecompressdir
358 find "${ED}" -name '*.ecompress.skip' -print0 | ${XARGS} -0 rm -f
359 exit 0
360 @@ -98,10 +99,10 @@ funk_up_dir() {
361 # absolute symlinks to files that aren't merged
362 # yet (bug #405327).
363 if [[ ${olddest} == /* ]] ; then
364 - [ -e "${D}${olddest}" ] && continue
365 + [ -e "${D%/}${olddest}" ] && continue
366 skip_dir_dest=${T}/ecompress-skip/${olddest#${EPREFIX}}
367 else
368 - skip_dir_dest=${T}/ecompress-skip/${actual_dir#${ED}}/${brokenlink%/*}/${olddest}
369 + skip_dir_dest=${T}/ecompress-skip/${actual_dir#${ED%/}}/${brokenlink%/*}/${olddest}
370 fi
371 [[ -e ${skip_dir_dest} ]] && continue
372 if [[ ${act} == "compress" ]] ; then
373 @@ -111,7 +112,7 @@ funk_up_dir() {
374 newdest=${olddest%${suffix}}
375 fi
376 if [[ "${newdest}" == /* ]] ; then
377 - [[ -f "${D}${newdest}" ]] || continue
378 + [[ -f "${D%/}${newdest}" ]] || continue
379 else
380 [[ -f "${dir}/${brokenlink%/*}/${newdest}" ]] || continue
381 fi
382 @@ -127,7 +128,7 @@ funk_up_dir() {
383 if (( indirection >= 100 )) ; then
384 # Protect against possibility of a bug triggering an endless loop.
385 eerror "ecompressdir: too many levels of indirection for" \
386 - "'${actual_dir#${ED}}/${something_changed#./}'"
387 + "'${actual_dir#${ED%/}}/${something_changed#./}'"
388 break
389 fi
390 done
391 @@ -171,9 +172,9 @@ __multijob_init
392
393 for dir in "$@" ; do
394 dir=${dir#/}
395 - dir="${ED}${dir}"
396 + dir="${ED%/}/${dir#/}"
397 if [[ ! -d ${dir} ]] ; then
398 - __vecho "${0##*/}: /${dir#${ED}} does not exist!"
399 + __vecho "${0##*/}: /${dir#${ED%/}} does not exist!"
400 continue
401 fi
402 cd "${dir}"
403 @@ -212,7 +213,7 @@ for dir in "$@" ; do
404
405 # now lets do our work
406 if [[ -n ${suffix} ]] ; then
407 - __vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${ED}}"
408 + __vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${ED%/}}"
409 funk_up_dir "compress" "${suffix}" "ecompress" "${size_limit}"
410 : $(( ret |= $? ))
411 fi
412 diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
413 index 85f7fd614..68004210b 100755
414 --- a/bin/ebuild-helpers/fowners
415 +++ b/bin/ebuild-helpers/fowners
416 @@ -1,5 +1,5 @@
417 #!/bin/bash
418 -# Copyright 1999-2012 Gentoo Foundation
419 +# Copyright 1999-2018 Gentoo Foundation
420 # Distributed under the terms of the GNU General Public License v2
421
422 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
423 @@ -11,7 +11,7 @@ fi
424 # we can't prefix all arguments because
425 # chown takes random options
426 slash="/"
427 -chown "${@/#${slash}/${ED}${slash}}"
428 +chown "${@/#${slash}/${ED%/}${slash}}"
429 ret=$?
430
431 [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
432 diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
433 index 297679cd0..c63a6abc3 100755
434 --- a/bin/ebuild-helpers/fperms
435 +++ b/bin/ebuild-helpers/fperms
436 @@ -1,5 +1,5 @@
437 #!/bin/bash
438 -# Copyright 1999-2012 Gentoo Foundation
439 +# Copyright 1999-2018 Gentoo Foundation
440 # Distributed under the terms of the GNU General Public License v2
441
442 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
443 @@ -11,7 +11,7 @@ fi
444 # we can't prefix all arguments because
445 # chmod takes random options
446 slash="/"
447 -chmod "${@/#${slash}/${ED}${slash}}"
448 +chmod "${@/#${slash}/${ED%/}${slash}}"
449 ret=$?
450 [[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed"
451 exit $ret
452 diff --git a/bin/ebuild-helpers/keepdir b/bin/ebuild-helpers/keepdir
453 index e0c852d08..a3c0c151c 100755
454 --- a/bin/ebuild-helpers/keepdir
455 +++ b/bin/ebuild-helpers/keepdir
456 @@ -1,5 +1,5 @@
457 #!/bin/bash
458 -# Copyright 1999-2013 Gentoo Foundation
459 +# Copyright 1999-2018 Gentoo Foundation
460 # Distributed under the terms of the GNU General Public License v2
461
462 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
463 @@ -12,8 +12,8 @@ dodir "$@"
464 ret=$?
465
466 for x in "$@"; do
467 - >> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
468 - { echo "!!! ${0##*/}: cannot write .keep in ${ED}${x}" 1>&2; ret=1; }
469 + >> "${ED%/}/${x#/}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
470 + { echo "!!! ${0##*/}: cannot write .keep in ${ED%/}/${x#/}" 1>&2; ret=1; }
471 done
472
473 [[ ${ret} -ne 0 ]] && __helpers_die "${0##*/} failed"
474 diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs
475 index cf63c64ed..6cdceb318 100755
476 --- a/bin/ebuild-helpers/prepalldocs
477 +++ b/bin/ebuild-helpers/prepalldocs
478 @@ -1,5 +1,5 @@
479 #!/bin/bash
480 -# Copyright 1999-2012 Gentoo Foundation
481 +# Copyright 1999-2018 Gentoo Foundation
482 # Distributed under the terms of the GNU General Public License v2
483
484 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
485 @@ -17,7 +17,7 @@ if ! ___eapi_has_prefix_variables; then
486 ED=${D}
487 fi
488
489 -[[ -d ${ED}usr/share/doc ]] || exit 0
490 +[[ -d ${ED%/}/usr/share/doc ]] || exit 0
491
492 ecompressdir --ignore /usr/share/doc/${PF}/html
493 ecompressdir --queue /usr/share/doc
494 diff --git a/bin/ebuild-helpers/prepallinfo b/bin/ebuild-helpers/prepallinfo
495 index cdf149e43..34d6a74b7 100755
496 --- a/bin/ebuild-helpers/prepallinfo
497 +++ b/bin/ebuild-helpers/prepallinfo
498 @@ -1,5 +1,5 @@
499 #!/bin/bash
500 -# Copyright 1999-2012 Gentoo Foundation
501 +# Copyright 1999-2018 Gentoo Foundation
502 # Distributed under the terms of the GNU General Public License v2
503
504 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
505 @@ -8,6 +8,6 @@ if ! ___eapi_has_prefix_variables; then
506 ED=${D}
507 fi
508
509 -[[ -d ${ED}usr/share/info ]] || exit 0
510 +[[ -d ${ED%/}/usr/share/info ]] || exit 0
511
512 exec prepinfo
513 diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo
514 index a64d144a3..eb1b6a7e3 100755
515 --- a/bin/ebuild-helpers/prepinfo
516 +++ b/bin/ebuild-helpers/prepinfo
517 @@ -1,5 +1,5 @@
518 #!/bin/bash
519 -# Copyright 1999-2012 Gentoo Foundation
520 +# Copyright 1999-2018 Gentoo Foundation
521 # Distributed under the terms of the GNU General Public License v2
522
523 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
524 @@ -11,14 +11,14 @@ fi
525 if [[ -z $1 ]] ; then
526 infodir="/usr/share/info"
527 else
528 - if [[ -d ${ED}$1/share/info ]] ; then
529 - infodir="$1/share/info"
530 + if [[ -d ${ED%/}/${1#/}/share/info ]] ; then
531 + infodir="${1#/}/share/info"
532 else
533 - infodir="$1/info"
534 + infodir="${1#/}/info"
535 fi
536 fi
537
538 -if [[ ! -d ${ED}${infodir} ]] ; then
539 +if [[ ! -d ${ED%/}/${infodir#/} ]] ; then
540 if [[ -n $1 ]] ; then
541 __vecho "${0##*/}: '${infodir}' does not exist!"
542 exit 1
543 @@ -27,7 +27,7 @@ if [[ ! -d ${ED}${infodir} ]] ; then
544 fi
545 fi
546
547 -find "${ED}${infodir}" -type d -print0 | while read -r -d $'\0' x ; do
548 +find "${ED%/}/${infodir#/}" -type d -print0 | while read -r -d $'\0' x ; do
549 for f in "${x}"/.keepinfodir*; do
550 [[ -e ${f} ]] && continue 2
551 done
552 diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman
553 index e64acc0b0..5e9fe45b6 100755
554 --- a/bin/ebuild-helpers/prepman
555 +++ b/bin/ebuild-helpers/prepman
556 @@ -1,5 +1,5 @@
557 #!/bin/bash
558 -# Copyright 1999-2012 Gentoo Foundation
559 +# Copyright 1999-2018 Gentoo Foundation
560 # Distributed under the terms of the GNU General Public License v2
561
562 # Do not compress man pages which are smaller than this (in bytes). #169260
563 @@ -12,13 +12,13 @@ if ! ___eapi_has_prefix_variables; then
564 fi
565
566 if [[ -z $1 ]] ; then
567 - mandir="${ED}usr/share/man"
568 + mandir="${ED%/}/usr/share/man"
569 else
570 - mandir="${ED}$1/man"
571 + mandir="${ED%/}/${1#/}/man"
572 fi
573
574 if [[ ! -d ${mandir} ]] ; then
575 - eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${ED}}'"
576 + eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${ED%/}}'"
577 exit 0
578 fi
579
580 @@ -34,6 +34,6 @@ for subdir in "${mandir}"/man* "${mandir}"/*/man* ; do
581 [[ -d ${subdir} ]] && really_is_mandir=1 && break
582 done
583
584 -[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --limit ${SIZE_LIMIT} --queue "${mandir#${ED}}"
585 +[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --limit ${SIZE_LIMIT} --queue "${mandir#${ED%/}}"
586
587 exit 0
588 diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
589 index 929547ae5..758591ff2 100755
590 --- a/bin/ebuild-helpers/prepstrip
591 +++ b/bin/ebuild-helpers/prepstrip
592 @@ -1,5 +1,5 @@
593 #!/bin/bash
594 -# Copyright 1999-2014 Gentoo Foundation
595 +# Copyright 1999-2018 Gentoo Foundation
596 # Distributed under the terms of the GNU General Public License v2
597
598 source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1
599 @@ -143,7 +143,7 @@ save_elf_debug() {
600 local x=$1
601 local inode_debug=$2
602 local splitdebug=$3
603 - local y=${ED}usr/lib/debug/${x:${#D}}.debug
604 + local y=${ED%/}/usr/lib/debug/${x:${#D}}.debug
605
606 # dont save debug info twice
607 [[ ${x} == *".debug" ]] && return 0
608 @@ -177,7 +177,7 @@ save_elf_debug() {
609 buildid=$(${READELF} -n "${x}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }')
610 fi
611 if [[ -n ${buildid} ]] ; then
612 - local buildid_dir="${ED}usr/lib/debug/.build-id/${buildid:0:2}"
613 + local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}"
614 local buildid_file="${buildid_dir}/${buildid:2}"
615 mkdir -p "${buildid_dir}"
616 [ -L "${buildid_file}".debug ] || ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug"
617 @@ -254,7 +254,7 @@ if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
618 # and start stripping the files ourselves. The log parsing can be done in
619 # parallel though.
620 log=${tmpdir}/scanelf-already-stripped.log
621 - scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "${log}"
622 + scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED%/}##" > "${log}"
623 (
624 __multijob_child_init
625 qa_var="QA_PRESTRIPPED_${ARCH/-/_}"
626 @@ -324,7 +324,7 @@ do
627 set -o noglob
628 strip_this=true
629 for m in $(eval echo ${STRIP_MASK}) ; do
630 - [[ /${x#${ED}} == ${m} ]] && strip_this=false && break
631 + [[ /${x#${ED%/}} == ${m} ]] && strip_this=false && break
632 done
633 set +o noglob
634 else
635 @@ -384,10 +384,10 @@ if [[ -s ${tmpdir}/debug.sources ]] && \
636 ${debugedit_found}
637 then
638 __vecho "installsources: rsyncing source files"
639 - [[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"
640 + [[ -d ${D%/}/${prepstrip_sources_dir#/} ]] || mkdir -p "${D%/}/${prepstrip_sources_dir#/}"
641 grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
642 (cd "${WORKDIR}"; LANG=C sort -z -u | \
643 - rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D}${prepstrip_sources_dir}/" )
644 + rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D%/}/${prepstrip_sources_dir#/}/" )
645
646 # Preserve directory structure.
647 # Needed after running save_elf_sources.
648 @@ -395,7 +395,7 @@ then
649 while read -r -d $'\0' emptydir
650 do
651 >> "${emptydir}"/.keepdir
652 - done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty -print0)
653 + done < <(find "${D%/}/${prepstrip_sources_dir#/}/" -type d -empty -print0)
654 fi
655
656 cd "${T}"
657 diff --git a/bin/install-qa-check.d/60udev b/bin/install-qa-check.d/60udev
658 index 4327d069d..c48d7d598 100644
659 --- a/bin/install-qa-check.d/60udev
660 +++ b/bin/install-qa-check.d/60udev
661 @@ -3,10 +3,10 @@
662 udev_check() {
663 set +f
664 local x f=
665 - for x in "${ED}etc/udev/rules.d/"* "${ED}lib"*"/udev/rules.d/"* ; do
666 + for x in "${ED%/}/etc/udev/rules.d/"* "${ED%/}/lib"*"/udev/rules.d/"* ; do
667 [[ -e ${x} ]] || continue
668 - [[ ${x} == ${ED}lib/udev/rules.d/* ]] && continue
669 - f+=" ${x#${ED}}\n"
670 + [[ ${x} == ${ED%/}/lib/udev/rules.d/* ]] && continue
671 + f+=" ${x#${ED%/}}\n"
672 done
673 if [[ -n $f ]] ; then
674 eqawarn "QA Notice: udev rules should be installed in /lib/udev/rules.d:"
675 diff --git a/bin/install-qa-check.d/80libraries b/bin/install-qa-check.d/80libraries
676 index e891b2d29..7f4390388 100644
677 --- a/bin/install-qa-check.d/80libraries
678 +++ b/bin/install-qa-check.d/80libraries
679 @@ -6,7 +6,7 @@ scanelf_lib_check() {
680 # Check for shared libraries lacking SONAMEs
681 local qa_var="QA_SONAME_${ARCH/-/_}"
682 eval "[[ -n \${!qa_var} ]] && QA_SONAME=(\"\${${qa_var}[@]}\")"
683 - f=$(scanelf -ByF '%S %p' "${ED}"{,usr/}lib*/lib*.so* | awk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED}:/:")
684 + f=$(scanelf -ByF '%S %p' "${ED%/}"/{,usr/}lib*/lib*.so* | awk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED%/}:/:")
685 if [[ -n ${f} ]] ; then
686 echo "${f}" > "${T}"/scanelf-missing-SONAME.log
687 if [[ "${QA_STRICT_SONAME-unset}" == unset ]] ; then
688 @@ -40,7 +40,7 @@ scanelf_lib_check() {
689 # Check for shared libraries lacking NEEDED entries
690 qa_var="QA_DT_NEEDED_${ARCH/-/_}"
691 eval "[[ -n \${!qa_var} ]] && QA_DT_NEEDED=(\"\${${qa_var}[@]}\")"
692 - f=$(scanelf -ByF '%n %p' "${ED}"{,usr/}lib*/lib*.so* | awk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED}:/:")
693 + f=$(scanelf -ByF '%n %p' "${ED%/}"/{,usr/}lib*/lib*.so* | awk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED%/}:/:")
694 if [[ -n ${f} ]] ; then
695 echo "${f}" > "${T}"/scanelf-missing-NEEDED.log
696 if [[ "${QA_STRICT_DT_NEEDED-unset}" == unset ]] ; then
697 @@ -81,16 +81,16 @@ lib_check() {
698
699 # this should help to ensure that all (most?) shared libraries are executable
700 # and that all libtool scripts / static libraries are not executable
701 - for i in "${ED}"opt/*/lib* \
702 - "${ED}"lib* \
703 - "${ED}"usr/lib* ; do
704 + for i in "${ED%/}"/opt/*/lib* \
705 + "${ED%/}"/lib* \
706 + "${ED%/}"/usr/lib* ; do
707 [[ ! -d ${i} ]] && continue
708
709 for j in "${i}"/*.so.* "${i}"/*.so ; do
710 [[ ! -e ${j} ]] && continue
711 [[ -L ${j} ]] && continue
712 [[ -x ${j} ]] && continue
713 - __vecho "making executable: ${j#${ED}}"
714 + __vecho "making executable: ${j#${ED%/}}"
715 chmod +x "${j}"
716 done
717
718 @@ -98,7 +98,7 @@ lib_check() {
719 [[ ! -e ${j} ]] && continue
720 [[ -L ${j} ]] && continue
721 [[ ! -x ${j} ]] && continue
722 - __vecho "removing executable bit: ${j#${ED}}"
723 + __vecho "removing executable bit: ${j#${ED%/}}"
724 chmod -x "${j}"
725 done
726
727 @@ -109,7 +109,7 @@ lib_check() {
728 if [[ ${linkdest} == /* ]] ; then
729 __vecho -ne '\n'
730 eqawarn "QA Notice: Found an absolute symlink in a library directory:"
731 - eqawarn " ${j#${D}} -> ${linkdest}"
732 + eqawarn " ${j#${D%/}} -> ${linkdest}"
733 eqawarn " It should be a relative symlink if in the same directory"
734 eqawarn " or a linker script if it crosses the /usr boundary."
735 fi
736 @@ -122,7 +122,7 @@ lib_check() {
737 # https://bugs.gentoo.org/4411
738 local abort="no"
739 local a s
740 - for a in "${ED}"usr/lib*/*.a ; do
741 + for a in "${ED%/}"/usr/lib*/*.a ; do
742 s=${a%.a}.so
743 if [[ ! -e ${s} ]] ; then
744 s=${s%usr/*}${s##*/usr/}
745 @@ -136,7 +136,7 @@ lib_check() {
746 [[ ${abort} == "yes" ]] && die "add those ldscripts"
747
748 # Make sure people don't store libtool files or static libs in /lib
749 - f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
750 + f=$(ls "${ED%/}"/lib*/*.{a,la} 2>/dev/null)
751 if [[ -n ${f} ]] ; then
752 __vecho -ne '\n'
753 eqawarn "QA Notice: Excessive files found in the / partition"
754 @@ -147,7 +147,7 @@ lib_check() {
755
756 # Verify that the libtool files don't contain bogus $D entries.
757 local abort=no gentoo_bug=no always_overflow=no
758 - for a in "${ED}"usr/lib*/*.la ; do
759 + for a in "${ED%/}"/usr/lib*/*.la ; do
760 s=${a##*/}
761 if grep -qs "${ED}" "${a}" ; then
762 __vecho -ne '\n'
763 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
764 index a02aa3bfd..7643af7b5 100755
765 --- a/bin/misc-functions.sh
766 +++ b/bin/misc-functions.sh
767 @@ -1,5 +1,5 @@
768 #!/bin/bash
769 -# Copyright 1999-2014 Gentoo Foundation
770 +# Copyright 1999-2018 Gentoo Foundation
771 # Distributed under the terms of the GNU General Public License v2
772 #
773 # Miscellaneous shell functions that make use of the ebuild env but don't need
774 @@ -87,7 +87,7 @@ prepcompress() {
775 # Canonicalize path names and check for their existence.
776 real_d=$(canonicalize "${ED}")
777 for (( i = 0; i < ${#PORTAGE_DOCOMPRESS[@]}; i++ )); do
778 - real_f=$(canonicalize "${ED}${PORTAGE_DOCOMPRESS[i]}")
779 + real_f=$(canonicalize "${ED%/}/${PORTAGE_DOCOMPRESS[i]#/}")
780 f=${real_f#"${real_d}"}
781 if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
782 then
783 @@ -98,7 +98,7 @@ prepcompress() {
784 fi
785 done
786 for (( i = 0; i < ${#PORTAGE_DOCOMPRESS_SKIP[@]}; i++ )); do
787 - real_f=$(canonicalize "${ED}${PORTAGE_DOCOMPRESS_SKIP[i]}")
788 + real_f=$(canonicalize "${ED%/}/${PORTAGE_DOCOMPRESS_SKIP[i]#/}")
789 f=${real_f#"${real_d}"}
790 if [[ ${real_f} != "${f}" ]] && [[ -d ${real_f} || -f ${real_f} ]]
791 then
792 @@ -147,7 +147,7 @@ prepcompress() {
793
794 # Split the include list into directories and files
795 for f in "${include[@]}"; do
796 - if [[ -d ${ED}${f} ]]; then
797 + if [[ -d ${ED%/}/${f#/} ]]; then
798 incl_d[${#incl_d[@]}]=${f}
799 else
800 incl_f[${#incl_f[@]}]=${f}
801 @@ -157,7 +157,7 @@ prepcompress() {
802 # Queue up for compression.
803 # ecompress{,dir} doesn't like to be called with empty argument lists.
804 [[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --limit ${PORTAGE_DOCOMPRESS_SIZE_LIMIT:-0} --queue "${incl_d[@]}"
805 - [[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ED}}"
806 + [[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ED%/}}"
807 [[ ${#exclude[@]} -gt 0 ]] && ecompressdir --ignore "${exclude[@]}"
808 return 0
809 }
810 @@ -253,7 +253,7 @@ install_qa_check() {
811 fi
812
813 # Portage regenerates this on the installed system.
814 - rm -f "${ED}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!"
815 + rm -f "${ED%/}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!"
816 }
817
818 preinst_qa_check() {
819 @@ -387,7 +387,7 @@ preinst_mask() {
820
821 # remove share dir if unnessesary
822 if has nodoc $FEATURES || has noman $FEATURES || has noinfo $FEATURES; then
823 - rmdir "${ED}usr/share" &> /dev/null
824 + rmdir "${ED%/}/usr/share" &> /dev/null
825 fi
826 }
827
828 @@ -407,11 +407,11 @@ preinst_sfperms() {
829 find "${ED}" -type f -perm -4000 -print0 | \
830 while read -r -d $'\0' i ; do
831 if [ -n "$(find "$i" -perm -2000)" ] ; then
832 - ebegin ">>> SetUID and SetGID: [chmod o-r] /${i#${ED}}"
833 + ebegin ">>> SetUID and SetGID: [chmod o-r] ${i#${ED%/}}"
834 chmod o-r "$i"
835 eend $?
836 else
837 - ebegin ">>> SetUID: [chmod go-r] /${i#${ED}}"
838 + ebegin ">>> SetUID: [chmod go-r] ${i#${ED%/}}"
839 chmod go-r "$i"
840 eend $?
841 fi
842 @@ -423,7 +423,7 @@ preinst_sfperms() {
843 # by the SetUID check above.
844 true
845 else
846 - ebegin ">>> SetGID: [chmod o-r] /${i#${ED}}"
847 + ebegin ">>> SetGID: [chmod o-r] ${i#${ED%/}}"
848 chmod o-r "$i"
849 eend $?
850 fi
851 @@ -452,7 +452,7 @@ preinst_suid_scan() {
852 __vecho ">>> Performing suid scan in ${ED}"
853 for i in $(find "${ED}" -type f \( -perm -4000 -o -perm -2000 \) ); do
854 if [ -s "${sfconf}" ]; then
855 - install_path=/${i#${ED}}
856 + install_path=${i#${ED%/}}
857 if grep -q "^${install_path}\$" "${sfconf}" ; then
858 __vecho "- ${install_path} is an approved suid file"
859 else
860 @@ -462,7 +462,7 @@ preinst_suid_scan() {
861 chmod ugo-s "${i}"
862 grep "^#${install_path}$" "${sfconf}" > /dev/null || {
863 __vecho ">>> Appending commented out entry to ${sfconf} for ${PF}"
864 - echo "## ${ls_ret%${ED}*}${install_path}" >> "${sfconf}"
865 + echo "## ${ls_ret%${ED%/}*}${install_path}" >> "${sfconf}"
866 echo "#${install_path}" >> "${sfconf}"
867 # no delwrite() eh?
868 # delwrite ${sconf}
869 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
870 index 3a2138636..5eeecfef7 100644
871 --- a/bin/phase-helpers.sh
872 +++ b/bin/phase-helpers.sh
873 @@ -29,8 +29,8 @@ into() {
874 if ! ___eapi_has_prefix_variables; then
875 local ED=${D}
876 fi
877 - if [ ! -d "${ED}${_E_DESTTREE_}" ]; then
878 - install -d "${ED}${_E_DESTTREE_}"
879 + if [ ! -d "${ED%/}/${_E_DESTTREE_#/}" ]; then
880 + install -d "${ED%/}/${_E_DESTTREE_#/}"
881 local ret=$?
882 if [[ $ret -ne 0 ]] ; then
883 __helpers_die "${FUNCNAME[0]} failed"
884 @@ -52,8 +52,8 @@ insinto() {
885 if ! ___eapi_has_prefix_variables; then
886 local ED=${D}
887 fi
888 - if [ ! -d "${ED}${_E_INSDESTTREE_}" ]; then
889 - install -d "${ED}${_E_INSDESTTREE_}"
890 + if [ ! -d "${ED%/}/${_E_INSDESTTREE_#/}" ]; then
891 + install -d "${ED%/}/${_E_INSDESTTREE_#/}"
892 local ret=$?
893 if [[ $ret -ne 0 ]] ; then
894 __helpers_die "${FUNCNAME[0]} failed"
895 @@ -75,8 +75,8 @@ exeinto() {
896 if ! ___eapi_has_prefix_variables; then
897 local ED=${D}
898 fi
899 - if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then
900 - install -d "${ED}${_E_EXEDESTTREE_}"
901 + if [ ! -d "${ED%/}/${_E_EXEDESTTREE_#/}" ]; then
902 + install -d "${ED%/}/${_E_EXEDESTTREE_#/}"
903 local ret=$?
904 if [[ $ret -ne 0 ]] ; then
905 __helpers_die "${FUNCNAME[0]} failed"
906 @@ -94,8 +94,8 @@ docinto() {
907 if ! ___eapi_has_prefix_variables; then
908 local ED=${D}
909 fi
910 - if [ ! -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
911 - install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
912 + if [ ! -d "${ED%/}/usr/share/doc/${PF}/${_E_DOCDESTTREE_#/}" ]; then
913 + install -d "${ED%/}/usr/share/doc/${PF}/${_E_DOCDESTTREE_#/}"
914 local ret=$?
915 if [[ $ret -ne 0 ]] ; then
916 __helpers_die "${FUNCNAME[0]} failed"
917 @@ -707,7 +707,7 @@ einstall() {
918 fi
919 unset LIBDIR_VAR
920 if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
921 - EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
922 + EI_DESTLIBDIR="${D%/}/${CONF_PREFIX}/${CONF_LIBDIR}"
923 EI_DESTLIBDIR="$(__strip_duplicate_slashes "${EI_DESTLIBDIR}")"
924 LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
925 unset EI_DESTLIBDIR
926 @@ -715,22 +715,22 @@ einstall() {
927
928 if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
929 if [ "${PORTAGE_DEBUG}" == "1" ]; then
930 - ${MAKE:-make} -n prefix="${ED}usr" \
931 - datadir="${ED}usr/share" \
932 - infodir="${ED}usr/share/info" \
933 - localstatedir="${ED}var/lib" \
934 - mandir="${ED}usr/share/man" \
935 - sysconfdir="${ED}etc" \
936 + ${MAKE:-make} -n prefix="${ED%/}/usr" \
937 + datadir="${ED%/}/usr/share" \
938 + infodir="${ED%/}/usr/share/info" \
939 + localstatedir="${ED%/}/var/lib" \
940 + mandir="${ED%/}/usr/share/man" \
941 + sysconfdir="${ED%/}/etc" \
942 ${LOCAL_EXTRA_EINSTALL} \
943 ${MAKEOPTS} -j1 \
944 "$@" ${EXTRA_EMAKE} install
945 fi
946 - if ! ${MAKE:-make} prefix="${ED}usr" \
947 - datadir="${ED}usr/share" \
948 - infodir="${ED}usr/share/info" \
949 - localstatedir="${ED}var/lib" \
950 - mandir="${ED}usr/share/man" \
951 - sysconfdir="${ED}etc" \
952 + if ! ${MAKE:-make} prefix="${ED%/}/usr" \
953 + datadir="${ED%/}/usr/share" \
954 + infodir="${ED%/}/usr/share/info" \
955 + localstatedir="${ED%/}/var/lib" \
956 + mandir="${ED%/}/usr/share/man" \
957 + sysconfdir="${ED%/}/etc" \
958 ${LOCAL_EXTRA_EINSTALL} \
959 ${MAKEOPTS} -j1 \
960 "$@" ${EXTRA_EMAKE} install
961 --
962 2.16.2

Replies