aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2010-03-09 02:12:38 +0000
committerAdam Vandenberg2010-08-07 18:08:49 -0700
commit0fcb5848621e08765adc0e394b5976db838399d9 (patch)
treee4e6ae2b53f0a68b66917141abfa6c56adf5fcea /Library
parent1c3f0e43dee3958c4ddbfdf0726817198725eeca (diff)
downloadbrew-0fcb5848621e08765adc0e394b5976db838399d9.tar.bz2
`brew create` uses new Aliasing system
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index bc0f59467..0040e83ef 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -36,12 +36,14 @@ def __make url, name
path = Formula.path name
raise "#{path} already exists" if path.exist?
-
- # Check if a formula aliased to this name exists.
- already_aka = Formulary.find_alias name
- if already_aka != nil
- opoo "Formula #{already_aka} is aliased to #{name}."
- puts "Please check if you are creating a duplicate."
+
+ if Formula.aliases.include? name and not ARGV.force?
+ realname = HOMEBREW_REPOSITORY.join("Library/Aliases/#{name}").realpath.basename('.rb')
+ raise <<-EOS.undent
+ The formula #{realname} is already aliased to #{name}
+ Please check that you are not creating a duplicate.
+ To force creation use --force.
+ EOS
end
version = Pathname.new(url).version