doins: tweak $DISTDIR symlink handling
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Apr 2011 01:09:20 +0000 (18:09 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 13 Apr 2011 07:50:52 +0000 (00:50 -0700)
Only match stuff inside $PORTAGE_ACTUAL_DISTDIR/ so that we don't
stray from PMS.

bin/ebuild-helpers/doins
pym/portage/package/ebuild/doebuild.py

index 3daa9a01a26a5fb1f34d0893f0959aaf1113aab8..bcef3118f10fe9374103b901431369119be6e1d4 100755 (executable)
@@ -59,9 +59,10 @@ _doins() {
                # 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.
+               # refer to absolute paths inside
+               # $PORTAGE_ACTUAL_DISTDIR/.
                if [ $PRESERVE_SYMLINKS = y ] && \
-                       ! [[ -f "$mysrc" && $(readlink "$mysrc") == /* ]] ; then
+                       ! [[ $(readlink "$mysrc") == "$PORTAGE_ACTUAL_DISTDIR"/* ]] ; then
                        rm -rf "$D$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
                        cp -P "$mysrc" "$D$INSDESTTREE/$mydir/${mysrc##*/}"
                        return $?
index 3d031716026d26ed16e6f8f22f552e8aed92ab16..f353166d78775738860595ce955e3012ac04fb13 100644 (file)
@@ -786,7 +786,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                # remove PORTAGE_ACTUAL_DISTDIR once cvs/svn is supported via SRC_URI
                if tree == 'porttree' and \
                        ((mydo != "setup" and "noauto" not in features) \
-                       or mydo == "unpack"):
+                       or mydo in ("install", "unpack")):
                        _prepare_fake_distdir(mysettings, alist)
 
                #initial dep checks complete; time to process main commands