Don't try to link symlinks over their targets

If we have lib/python3.4/site-packages, which is a symlink to
HOMEBREW_PREFIX/lib/python3.4/site-packages, link will be confused. This
only appears after unlinking and relinking because this symlink is
created in post_install, which runs after the first link.

Fixes Homebrew/linuxbrew#502.

Closes Homebrew/homebrew#42891.
This commit is contained in:
Tim D. Smith 2015-08-13 00:13:21 -07:00
parent f5642cb105
commit 88e8e6cf60

View File

@ -422,6 +422,7 @@ class Keg
if src.symlink? || src.file?
Find.prune if File.basename(src) == ".DS_Store"
Find.prune if src.realpath == dst
# Don't link pyc files because Python overwrites these cached object
# files and next time brew wants to link, the pyc file is in the way.
if src.extname == ".pyc" && src.to_s =~ /site-packages/