aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/brew.h.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2010-09-22 12:32:16 -0700
committerAdam Vandenberg2010-09-29 21:55:44 -0700
commitbb01afce4c0804b3603602496292077d3d92f0a4 (patch)
tree46d30b214a5e1d2dc49dcc684f758a3afc2c1e80 /Library/Homebrew/brew.h.rb
parent18f9969b65d3a9a39ae721c1d967d596b7aef898 (diff)
downloadbrew-bb01afce4c0804b3603602496292077d3d92f0a4.tar.bz2
Move resolve_alias from ARGV to Formula
Also, call this function from a few places where the code was duplicated.
Diffstat (limited to 'Library/Homebrew/brew.h.rb')
-rw-r--r--Library/Homebrew/brew.h.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index a35ca0b49..2eb6f8e2e 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -39,9 +39,9 @@ def __make url, name
raise "#{path} already exists" if path.exist?
if Formula.aliases.include? name and not ARGV.force?
- realname = HOMEBREW_REPOSITORY.join("Library/Aliases/#{name}").realpath.basename('.rb')
+ realname = Formula.resolve_alias(name)
raise <<-EOS.undent
- The formula #{realname} is already aliased to #{name}
+ "#{name}" is an alias for formula "#{realname}".
Please check that you are not creating a duplicate.
To force creation use --force.
EOS
@@ -430,8 +430,7 @@ def search_brews text
# Filter out aliases when the full name was also found
results.reject do |alias_name|
if aliases.include? alias_name
- resolved_name = (HOMEBREW_REPOSITORY+"Library/Aliases/#{alias_name}").readlink.basename('.rb').to_s
- results.include? resolved_name
+ results.include? Formula.resolve_alias(alias_name)
end
end
end