summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2014-03-30 08:41:53 +0000
committerMichał Górny <mgorny@gentoo.org>2014-03-30 08:41:53 +0000
commitb55d426c9ee6ba3de1163c53f5f296ba792b802f (patch)
tree5016d27216c773365288290f5c7d35d6f9335129 /eclass/multilib-build.eclass
parentapp-mobilephone/obexd isn't used, it uses bluez-5 provided one. Drop old. (diff)
downloadhistorical-b55d426c9ee6ba3de1163c53f5f296ba792b802f.tar.gz
historical-b55d426c9ee6ba3de1163c53f5f296ba792b802f.tar.bz2
historical-b55d426c9ee6ba3de1163c53f5f296ba792b802f.zip
Support rewriting symlinks in MULTILIB_CHOST_TOOLS, bug #506062.
Diffstat (limited to 'eclass/multilib-build.eclass')
-rw-r--r--eclass/multilib-build.eclass23
1 files changed, 20 insertions, 3 deletions
diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
index 59d452c9e396..359ad45fff4f 100644
--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.28 2014/03/29 03:00:44 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.29 2014/03/30 08:41:53 mgorny Exp $
# @ECLASS: multilib-build.eclass
# @MAINTAINER:
@@ -246,8 +246,13 @@ multilib_copy_sources() {
# and the native variant will be symlinked to the generic name.
#
# This variable has to be a bash array. Paths shall be relative to
-# installation root (${ED}), and name regular files. Recursive wrapping
-# is not supported.
+# installation root (${ED}), and name regular files or symbolic
+# links to regular files. Recursive wrapping is not supported.
+#
+# If symbolic link is passed, both symlink path and symlink target
+# will be changed. As a result, the symlink target is expected
+# to be wrapped as well (either by listing in MULTILIB_CHOST_TOOLS
+# or externally).
#
# Please note that tool wrapping is *discouraged*. It is preferred to
# install pkg-config files for each ABI, and require reverse
@@ -374,6 +379,18 @@ _EOF_
local dir=${f%/*}
local fn=${f##*/}
+ if [[ -L ${root}/${f} ]]; then
+ # rewrite the symlink target
+ local target=$(readlink "${root}/${f}")
+ local target_dir
+ local target_fn=${target##*/}
+
+ [[ ${target} == */* ]] && target_dir=${target%/*}
+
+ ln -f -s "${target_dir+${target_dir}/}${CHOST}-${target_fn}" \
+ "${root}/${f}" || die
+ fi
+
mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
# symlink the native one back