Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog multilib-build.eclass
Date: Sun, 30 Mar 2014 08:41:57
Message-Id: 20140330084153.AD4E120057@flycatcher.gentoo.org
1 mgorny 14/03/30 08:41:53
2
3 Modified: ChangeLog multilib-build.eclass
4 Log:
5 Support rewriting symlinks in MULTILIB_CHOST_TOOLS, bug #506062.
6
7 Revision Changes Path
8 1.1187 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1187&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1187&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1186&r2=1.1187
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.1186
18 retrieving revision 1.1187
19 diff -u -r1.1186 -r1.1187
20 --- ChangeLog 29 Mar 2014 16:06:44 -0000 1.1186
21 +++ ChangeLog 30 Mar 2014 08:41:53 -0000 1.1187
22 @@ -1,6 +1,9 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1186 2014/03/29 16:06:44 ulm Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1187 2014/03/30 08:41:53 mgorny Exp $
27 +
28 + 30 Mar 2014; Michał Górny <mgorny@g.o> multilib-build.eclass:
29 + Support rewriting symlinks in MULTILIB_CHOST_TOOLS, bug #506062.
30
31 29 Mar 2014; Ulrich Müller <ulm@g.o> check-reqs.eclass:
32 Move test for MERGE_TYPE from check-reqs_pkg_setup() to check-reqs_run().
33
34
35
36 1.29 eclass/multilib-build.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.29&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.29&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?r1=1.28&r2=1.29
41
42 Index: multilib-build.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v
45 retrieving revision 1.28
46 retrieving revision 1.29
47 diff -u -r1.28 -r1.29
48 --- multilib-build.eclass 29 Mar 2014 03:00:44 -0000 1.28
49 +++ multilib-build.eclass 30 Mar 2014 08:41:53 -0000 1.29
50 @@ -1,6 +1,6 @@
51 # Copyright 1999-2014 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.28 2014/03/29 03:00:44 vapier Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.29 2014/03/30 08:41:53 mgorny Exp $
55
56 # @ECLASS: multilib-build.eclass
57 # @MAINTAINER:
58 @@ -246,8 +246,13 @@
59 # and the native variant will be symlinked to the generic name.
60 #
61 # This variable has to be a bash array. Paths shall be relative to
62 -# installation root (${ED}), and name regular files. Recursive wrapping
63 -# is not supported.
64 +# installation root (${ED}), and name regular files or symbolic
65 +# links to regular files. Recursive wrapping is not supported.
66 +#
67 +# If symbolic link is passed, both symlink path and symlink target
68 +# will be changed. As a result, the symlink target is expected
69 +# to be wrapped as well (either by listing in MULTILIB_CHOST_TOOLS
70 +# or externally).
71 #
72 # Please note that tool wrapping is *discouraged*. It is preferred to
73 # install pkg-config files for each ABI, and require reverse
74 @@ -374,6 +379,18 @@
75 local dir=${f%/*}
76 local fn=${f##*/}
77
78 + if [[ -L ${root}/${f} ]]; then
79 + # rewrite the symlink target
80 + local target=$(readlink "${root}/${f}")
81 + local target_dir
82 + local target_fn=${target##*/}
83 +
84 + [[ ${target} == */* ]] && target_dir=${target%/*}
85 +
86 + ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \
87 + "${root}/${f}" || die
88 + fi
89 +
90 mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
91
92 # symlink the native one back