brew create uses new Aliasing system

This commit is contained in:
Max Howell 2010-03-09 02:12:38 +00:00 committed by Adam Vandenberg
parent 1c3f0e43de
commit 0fcb584862

View File

@ -37,11 +37,13 @@ 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