Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: readlink requires chdir for relative links
Fixes Homebrew#2650 (although there is more work to be done). The issue is that path.readlink.exist? returned false for all relative links, because readlink reads relative to the current working directory. This caused relative symlinks such as /usr/bin/tar to be deleted, because package mosh identified /usr/bin as one of its container directories. The simplest fix is not to use readlink at all, because path.exist? will tell us what we want to know, independent of current dir.
- Loading branch information