bottle: remove bottle_filename_formula_name

This commit is contained in:
Xu Cheng 2015-05-27 23:00:42 +08:00
parent 99ba9faf09
commit be18a816af

View File

@ -136,11 +136,6 @@ module Homebrew
end end
filename = Bottle::Filename.create(f, bottle_tag, bottle_revision) filename = Bottle::Filename.create(f, bottle_tag, bottle_revision)
if bottle_filename_formula_name(filename).empty?
return ofail "Add a new regex to bottle_version.rb to parse #{f.version} from #{filename}"
end
bottle_path = Pathname.pwd/filename bottle_path = Pathname.pwd/filename
prefix = HOMEBREW_PREFIX.to_s prefix = HOMEBREW_PREFIX.to_s
@ -209,7 +204,10 @@ module Homebrew
puts output puts output
if ARGV.include? '--rb' if ARGV.include? '--rb'
File.open("#{filename.prefix}.bottle.rb", "w") { |file| file.write(output) } File.open("#{filename.prefix}.bottle.rb", "w") do |file|
file.write("\# #{f.full_name}\n")
file.write(output)
end
end end
end end
@ -222,9 +220,9 @@ module Homebrew
def merge def merge
merge_hash = {} merge_hash = {}
ARGV.named.each do |argument| ARGV.named.each do |argument|
formula_name = bottle_filename_formula_name argument bottle_block = IO.read(argument)
formula_name = bottle_block.lines.first.sub(/^# /,"").chomp
merge_hash[formula_name] ||= [] merge_hash[formula_name] ||= []
bottle_block = IO.read argument
merge_hash[formula_name] << bottle_block merge_hash[formula_name] << bottle_block
end end
@ -238,13 +236,7 @@ module Homebrew
puts output puts output
if ARGV.include? '--write' if ARGV.include? '--write'
tap = ARGV.value('tap') f = Formulary.factory(formula_name)
canonical_formula_name = if tap
"#{tap}/#{formula_name}"
else
formula_name
end
f = Formulary.factory(canonical_formula_name)
update_or_add = nil update_or_add = nil
Utils::Inreplace.inreplace(f.path) do |s| Utils::Inreplace.inreplace(f.path) do |s|