diff options
| author | Max Howell | 2010-03-09 02:12:38 +0000 |
|---|---|---|
| committer | Adam Vandenberg | 2010-08-07 18:08:49 -0700 |
| commit | 3fca97ae4b037ce5ffc2818ad38a3fc3aafdfe6f (patch) | |
| tree | 6e40c5dfe616a766ab4fed444637bfe86b67e0d0 /Library | |
| parent | 477b59fe3a1e4020c7cabe8577a0edb9679cb4b0 (diff) | |
| download | homebrew-3fca97ae4b037ce5ffc2818ad38a3fc3aafdfe6f.tar.bz2 | |
`brew create` uses new Aliasing system
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/brew.h.rb | 14 |
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 |
