We shouldn't unlink, we should just delete any symlinks created during this link step. Rationale: linking often fails due to conflicts with another formula's symlinks. Unlinking deletes the conflicting file. Eg:
Linking bar when foo is already linked will result in the /usr/local/bin/a symlink being deleted!
Kinda related: #12778
At least, there is some discussion about unlinking things that don't resolve into the correct keg.
Does anybody mind if I try to "take a stab" at this ?
Actually, the original issue is taken care of. Unlinking will no longer remove symlinks that resolve into other kegs. I'll close this issue given that.
Thanks for the offer of help though, really appreciate it!