aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-05-27 23:00:42 +0800
committerXu Cheng2015-06-02 16:45:44 +0800
commitbe18a816afe27ee48eef1914c1b27c51db304831 (patch)
treeb855a903f0c7191343086eaf685eb4fe22c1923b /Library
parent99ba9faf09c7bbc1110de68b1f47bdff1b95191c (diff)
downloadbrew-be18a816afe27ee48eef1914c1b27c51db304831.tar.bz2
bottle: remove bottle_filename_formula_name
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/bottle.rb22
1 files changed, 7 insertions, 15 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 51df4ec05..966b13721 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -136,11 +136,6 @@ module Homebrew
end
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
prefix = HOMEBREW_PREFIX.to_s
@@ -209,7 +204,10 @@ module Homebrew
puts output
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
@@ -222,9 +220,9 @@ module Homebrew
def merge
merge_hash = {}
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] ||= []
- bottle_block = IO.read argument
merge_hash[formula_name] << bottle_block
end
@@ -238,13 +236,7 @@ module Homebrew
puts output
if ARGV.include? '--write'
- tap = ARGV.value('tap')
- canonical_formula_name = if tap
- "#{tap}/#{formula_name}"
- else
- formula_name
- end
- f = Formulary.factory(canonical_formula_name)
+ f = Formulary.factory(formula_name)
update_or_add = nil
Utils::Inreplace.inreplace(f.path) do |s|