Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 4/8] multilib-build.eclass: Enable EAPI 7 support
Date: Thu, 03 May 2018 10:20:16
Message-Id: 20180503101811.28837-5-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one by "Michał Górny"
1 Enable EAPI 7. Correct all ${ED} references to account both for
2 trailing slash being present and absent.
3 ---
4 eclass/multilib-build.eclass | 22 +++++++++++-----------
5 1 file changed, 11 insertions(+), 11 deletions(-)
6
7 diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
8 index 6356350c43b3..261f0f4a170b 100644
9 --- a/eclass/multilib-build.eclass
10 +++ b/eclass/multilib-build.eclass
11 @@ -1,4 +1,4 @@
12 -# Copyright 1999-2015 Gentoo Foundation
13 +# Copyright 1999-2018 Gentoo Foundation
14 # Distributed under the terms of the GNU General Public License v2
15
16 # @ECLASS: multilib-build.eclass
17 @@ -20,7 +20,7 @@ if [[ ! ${_MULTILIB_BUILD} ]]; then
18
19 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
20 case ${EAPI:-0} in
21 - 4|5|6) ;;
22 + 4|5|6|7) ;;
23 *) die "EAPI=${EAPI} is not supported" ;;
24 esac
25
26 @@ -269,8 +269,8 @@ multilib_check_headers() {
27 _multilib_header_cksum() {
28 set -o pipefail
29
30 - if [[ -d ${ED}usr/include ]]; then
31 - find "${ED}"usr/include -type f \
32 + if [[ -d ${ED%/}/usr/include ]]; then
33 + find "${ED%/}"/usr/include -type f \
34 -exec cksum {} + | sort -k2
35 fi
36 }
37 @@ -390,7 +390,7 @@ multilib_prepare_wrappers() {
38
39 [[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
40
41 - local root=${1:-${ED}}
42 + local root=${1:-${ED%/}}
43 local f
44
45 if [[ ${COMPLETE_MULTILIB} == yes ]]; then
46 @@ -458,9 +458,9 @@ multilib_prepare_wrappers() {
47
48 # Some ABIs may have install less files than others.
49 if [[ -f ${root}/usr/include${f} ]]; then
50 - local wrapper=${ED}/tmp/multilib-include${f}
51 + local wrapper=${ED%/}/tmp/multilib-include${f}
52
53 - if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
54 + if [[ ! -f ${ED%/}/tmp/multilib-include${f} ]]; then
55 dodir "/tmp/multilib-include${dir}"
56 # a generic template
57 cat > "${wrapper}" <<_EOF_ || die
58 @@ -518,7 +518,7 @@ _EOF_
59
60 # $CHOST shall be set by multilib_toolchain_setup
61 dodir "/tmp/multilib-include/${CHOST}${dir}"
62 - mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
63 + mv "${root}/usr/include${f}" "${ED%/}/tmp/multilib-include/${CHOST}${dir}/" || die
64
65 # Note: match a space afterwards to avoid collision potential.
66 sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
67 @@ -558,11 +558,11 @@ multilib_install_wrappers() {
68
69 local root=${1:-${ED}}
70
71 - if [[ -d "${ED}"/tmp/multilib-include ]]; then
72 + if [[ -d ${ED%/}/tmp/multilib-include ]]; then
73 multibuild_merge_root \
74 - "${ED}"/tmp/multilib-include "${root}"/usr/include
75 + "${ED%/}"/tmp/multilib-include "${root}"/usr/include
76 # it can fail if something else uses /tmp
77 - rmdir "${ED}"/tmp &>/dev/null
78 + rmdir "${ED%/}"/tmp &>/dev/null
79 fi
80 }
81
82 --
83 2.17.0