Use canonical_name when checking LinkedKegs and opt

name is the user-provided string and may be an alias, path, or URL.
This commit is contained in:
Jack Nagel 2014-06-26 22:44:31 -05:00
parent 401bc1c6c7
commit cfd02fd415

View File

@ -20,10 +20,10 @@ module HomebrewArgvExtension
rack = HOMEBREW_CELLAR/canonical_name
dirs = rack.directory? ? rack.subdirs : []
raise NoSuchKegError.new(rack.basename.to_s) if dirs.empty?
raise NoSuchKegError.new(canonical_name) if dirs.empty?
linked_keg_ref = HOMEBREW_REPOSITORY/"Library/LinkedKegs"/name
opt_prefix = HOMEBREW_PREFIX/"opt"/name
linked_keg_ref = HOMEBREW_LIBRARY.join("LinkedKegs", canonical_name)
opt_prefix = HOMEBREW_PREFIX.join("opt", canonical_name)
begin
if opt_prefix.symlink? && opt_prefix.directory?