Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: multilib@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 4/5] Move tool renaming code earlier.
Date: Thu, 24 Apr 2014 20:27:07
Message-Id: 1398371199-21869-4-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] multilib RFC: improving wrapping compatibility with non-multilib and multilib-portage systems by "Michał Górny"
1 It is simpler than header wrapping, and now it comes directly after the
2 multilib-portage variant. Also, it will make it possible to disable
3 header wrapping on some systems easily.
4 ---
5 eclass/multilib-build.eclass | 54 ++++++++++++++++++++++----------------------
6 1 file changed, 27 insertions(+), 27 deletions(-)
7
8 diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
9 index 755d774..9dfec0a 100644
10 --- a/eclass/multilib-build.eclass
11 +++ b/eclass/multilib-build.eclass
12 @@ -315,6 +315,33 @@ multilib_prepare_wrappers() {
13 return
14 fi
15
16 + for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
17 + # drop leading slash if it's there
18 + f=${f#/}
19 +
20 + local dir=${f%/*}
21 + local fn=${f##*/}
22 +
23 + if [[ -L ${root}/${f} ]]; then
24 + # rewrite the symlink target
25 + local target=$(readlink "${root}/${f}")
26 + local target_dir
27 + local target_fn=${target##*/}
28 +
29 + [[ ${target} == */* ]] && target_dir=${target%/*}
30 +
31 + ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \
32 + "${root}/${f}" || die
33 + fi
34 +
35 + mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
36 +
37 + # symlink the native one back
38 + if multilib_build_binaries; then
39 + ln -s "${CHOST}-${fn}" "${root}/${f}" || die
40 + fi
41 + done
42 +
43 for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
44 # drop leading slash if it's there
45 f=${f#/}
46 @@ -388,33 +415,6 @@ _EOF_
47 -i "${ED}/tmp/multilib-include${f}" || die
48 fi
49 done
50 -
51 - for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
52 - # drop leading slash if it's there
53 - f=${f#/}
54 -
55 - local dir=${f%/*}
56 - local fn=${f##*/}
57 -
58 - if [[ -L ${root}/${f} ]]; then
59 - # rewrite the symlink target
60 - local target=$(readlink "${root}/${f}")
61 - local target_dir
62 - local target_fn=${target##*/}
63 -
64 - [[ ${target} == */* ]] && target_dir=${target%/*}
65 -
66 - ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \
67 - "${root}/${f}" || die
68 - fi
69 -
70 - mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
71 -
72 - # symlink the native one back
73 - if multilib_build_binaries; then
74 - ln -s "${CHOST}-${fn}" "${root}/${f}" || die
75 - fi
76 - done
77 }
78
79 # @FUNCTION: multilib_install_wrappers
80 --
81 1.9.2