ContinuumIO/conda — pull request #437 by minrk (2013-12-18 21:23:29+00:00)
Title: copy symlinks as symlinks

rather than copying file contents or hard linking.

I'm not convinced this is the right fix, but it does address an actual problem:

I was building a package for nodejs, and it's a trivial configure/make/make install. But the installed result doesn't work, and I tracked it down to copying `bin/npm`, which is a symlink to `lib/node_modules/npm/npm-cli.js` in the actual package.

node's insane module-loading mechanism actually depends on the location of the file, and hardlinking or copying will cause module loading to break.

This patch causes relative symlinks to be copied *as symlinks*, so that the structure of the resulting tree is preserved.

I'm especially unsure that fitting this behavior under LINK_COPY is the right thing to do, but a better choice was not immediately apparent.