aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-04-11 16:23:54 -0700
committerZac Medico <zmedico@gentoo.org>2011-04-11 16:23:54 -0700
commit2e334d77e3d1836ab6ba5dfc1700e90f9599d4d3 (patch)
tree38552b608c5423028d4eb58c4fbb36c2d88fb6fa /bin
parentextract_affecting_use: test bug #363073 (diff)
downloadportage-2e334d77e3d1836ab6ba5dfc1700e90f9599d4d3.tar.gz
portage-2e334d77e3d1836ab6ba5dfc1700e90f9599d4d3.tar.bz2
portage-2e334d77e3d1836ab6ba5dfc1700e90f9599d4d3.zip
doins: dereference abs symlinks to files
Our fake $DISTDIR contains symlinks that should not be reproduced inside $D. In order to ensure that things like dodoc "$DISTDIR"/foo.pdf work as expected, we dereference symlinked files that are referenced by absolute paths. Thanks to James Cloos <cloos@jhcloos.com> for reporting this issue which he observed with the sci-mathematics/minisat ebuild.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild-helpers/doins8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index 0aedcb9e5..3daa9a01a 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -55,7 +55,13 @@ _doins() {
local mysrc="$1" mydir="$2" cleanup="" rval
if [ -L "$mysrc" ] ; then
- if [ $PRESERVE_SYMLINKS = y ] ; then
+ # Our fake $DISTDIR contains symlinks that should
+ # not be reproduced inside $D. In order to ensure
+ # that things like dodoc "$DISTDIR"/foo.pdf work
+ # as expected, we dereference symlinked files that
+ # are referenced by absolute paths.
+ if [ $PRESERVE_SYMLINKS = y ] && \
+ ! [[ -f "$mysrc" && $(readlink "$mysrc") == /* ]] ; then
rm -rf "$D$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
cp -P "$mysrc" "$D$INSDESTTREE/$mydir/${mysrc##*/}"
return $?