diff options
| author | Martin Afanasjew | 2015-10-20 07:16:18 +0200 |
|---|---|---|
| committer | Mike McQuaid | 2015-10-20 08:38:54 +0100 |
| commit | eb5d90c1df4ffcb6189e3bf96a5d75940ca37e38 (patch) | |
| tree | 39dfd943910f66587dde5f326c24bcbe3bd0eb99 /share | |
| parent | 3dda14f5bdf2e3b22f0fb94cac4afcbbae2fa682 (diff) | |
| download | brew-eb5d90c1df4ffcb6189e3bf96a5d75940ca37e38.tar.bz2 | |
unlinkapps: avoid deleting too many symlinks
Use `start_with?` to make sure the symlink actually points into one of
the Homebrew directories (depending on given arguments). Previously,
only a substring match was used, which would also remove a symlink to a
hypothetical `/opt/unrelated/usr/local/opt/Unrelated.app`. Even if
unlikely to occur, altering stuff unrelated to Homebrew is bad.
Furthermore, make sure to always use a trailing slash with directories.
Otherwise, e.g., `brew unlinkapps qt` will unlink .app bundles of both
`qt` and `qt5` if both are installed and `brew linkapps qt qt5` was
issued before. (Please ignore that `qt` and `qt5` offer a conflicting
set of .app bundles. This will have to be addressed elsewhere.)
Closes Homebrew/homebrew#45174.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions
