dosym: add $EPREFIX to absolute target
authorJeremy Olexa <darkside@gentoo.org>
Thu, 29 Mar 2012 22:02:56 +0000 (15:02 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 29 Mar 2012 22:11:41 +0000 (15:11 -0700)
bin/ebuild-helpers/dosym

index 5e41ec4563510c960e45d3b5341a3d198741c893..2489e22a2366f8f2968b1b0db5d09705bd88d2fd 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -20,8 +20,11 @@ fi
 
 destdir=${2%/*}
 [[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
+# when absolute, prefix with offset for Gentoo Prefix
+target="${1}"
+[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
+ln -snf "${target}" "${ED}${2}"
 
-ln -snf "$1" "${ED}$2"
 ret=$?
 [[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
 exit $ret